码迷,mamicode.com
首页 > 数据库 > 详细

ubuntu安装mysql

时间:2018-06-21 11:34:58      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:安装   word   rect   roo   密码   read_only   解决方法   ade   另一个   

安装mysql

1.sudo apt-get install mysql-client mysql-server

启动

2.service mysqld start

登陆

3.mysql -uroot

报错Access denied for user ‘root‘@‘localhost‘

先关闭mysql

4.service mysqld stop

安全启动MySQL(跳过密码验证)

5./usr/bin/mysqld_safe --skip-grant-tables

又报错mysqld_safe Directory ‘/var/run/mysqld‘ for UNIX socket file don‘t exists

解决方法

6.mkdir -p /var/run/mysqld

7.chown mysql:mysql /var/run/mysqld

重新安全启动

8./usr/bin/mysqld_safe --skip-grant-tables

打开另一个终端,登陆mysql

9.mysql -uroot

修改密码

10.grant all privileges on *.* to ‘root‘@‘localhost‘ identified by ‘123465‘ with grant option;

报错ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

修改读写权限

11.set global read_only=0;

flush privileges;

再次修改密码,报错Plugin ‘auth_socket‘ is not loaded

修改user表

12.update user set plugin="mysql_native_password";

flush privileges;

再次修改密码

13.grant all privileges on *.to ‘root‘@‘localhost‘ identified by ‘123465‘ with grant option;

flush privileges;

 

修改成功

ubuntu安装mysql

标签:安装   word   rect   roo   密码   read_only   解决方法   ade   另一个   

原文地址:https://www.cnblogs.com/kevin19931015/p/9206942.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!