首页 > 数据库技术 > 详细

ubuntu安装mysql

时间:2018-06-21 10:55:09      阅读:210      评论:0      收藏:0      [点我收藏+]

安装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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!