mysql-init-install

./bin/msyql_install_db --user=mysql # 初始化数据库

./bin/mysqld_safe --user=mysql & # 由于这种不是通过启动脚本开启的,没办法通过启动脚本关闭

./bin/mysqladmin

delete from mysql.user where host='localhost' and user=''; # 删除匿名用户

flush privileges; # 刷新授权

set password for 'root'@'localhost' = password('123654'); # 登陆后的更新密码

./bin/mysqladmin  -uroot password oldpass 'newpass' # 不用登陆更新密码

./bin/mysqladmin -uroot -p shoudown # 输入密码后,关闭mysql