在ubuntu中打开mysql,进入相应目录,执行命令sudo ./mysqld_safe -user=mysql &
因为shell刚打开需输入密码,结果如下,此时输入密码也会报错,要先执行另一个sudo命令才行
zhang@zhang-laptop:~$ cd /usr/local/mysql/bin
zhang@zhang-laptop:/usr/local/mysql/bin$ sudo ./mysqld_safe -user=mysql &
[1] 6197
zhang@zhang-laptop:/usr/local/mysql/bin$ Password:
[1]+ Stopped sudo ./mysqld_safe -user=mysql
zhang@zhang-laptop:/usr/local/mysql/bin$ sudo ls
Password:
comp_err mysql_config mysqlshow
innochecksum mysql_convert_table_format mysql_tableinfo
msql2mysql mysqld_multi mysqltest
myisamchk mysqld_safe mysqltestmanagerc
myisam_ftdump mysqldump mysqltestmanager-pwgen
myisamlog mysqldumpslow mysql_tzinfo_to_sql
myisampack mysql_explain_log mysql_upgrade
my_print_defaults mysql_find_rows mysql_upgrade_shell
mysql mysql_fix_extensions mysql_waitpid
mysqlaccess mysql_fix_privilege_tables mysql_zap
mysqladmin mysqlhotcopy perror
mysqlbinlog mysqlimport replace
mysqlbug mysql_install_db resolveip
mysqlcheck mysql_secure_installation resolve_stack_dump
mysql_client_test mysql_setpermission
zhang@zhang-laptop:/usr/local/mysql/bin$ sudo ./mysqld_safe -user=mysql &
[2] 6211
zhang@zhang-laptop:/usr/local/mysql/bin$ Starting mysqld daemon with databases from /usr/local/mysql/var
zhang@zhang-laptop:/usr/local/mysql/bin$