mysql的初始化配置及命令行选项

查找配置文件的顺序及参数:

  /usr/bin/mysql --help --verborse查看:

  Default options are read from the following files in the given order:/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf

设置密码:

  启动服务:systemctl start mariadb

  连接服务器:mysql

  选择mysql表:use mysql;

  删除无user项:  

  drop user ''@'localhost';

  drop user ''@'www.centos.pig';

  设置密码:update  user set passeord=password('your_password') where user='root';

  让服务器重读:flush privileges;

posted @ 2015-08-10 17:28  codeZhu  阅读(1632)  评论(0编辑  收藏  举报