更新源:
apt-get update
安装Mysql:
apt-get install mysql-server
登录:
mysql -uroot -p
默认密码root(如果不对,试试不输入密码)
登录成功后,重新设置密码:
set password=password ("root");
刷新
flush privileges;
安装失败了,删除MySQL:
apt-get autoremove mysql* --purge
添加开机启动:
update-rc.d -f mysql defaults
取消开机启动:
update-rc.d -f mysql remove
开机启动失败:perl: warning: Setting locale failed.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "zh_CN.UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
root@a8dfe3ca5d1b:/opt/wvp# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
查看locale命令,可看到,LANG和LANGUAGE都没赋值。
apt-get install language-pack-zh-han*
看到
Generating locales (this might take a while)...
zh_CN.UTF-8... done
zh_HK.UTF-8... done
zh_SG.UTF-8... done
zh_TW.UTF-8... done
Generation complete.
然后再执行:update-rc.d -f mysql defaults
重启,看mysql是否已开机启动。我的仍不能启动。
后来,我直接把启动命令
service mysql start
加到了自己程序脚本run.sh中。我这个暴脾气呀,啥时候才能改改