Ubuntu下的的Mysql

一、安装

通过使用sudo apt-get install mysql-server安装库中最新版本的mysql

安装好之后,使用mysql -u root -p进入mysql时报错。

通过在/etc/mysql/mysql.conf目录下的mysqld.cnf文件中增加skip-grant-tables,以便在登录时可以无需密码进入mysql

修改后需要使用service mysql restart命令来重启mysql服务,使得刚刚添加的属性生效

使用use mysql;

使用select user, plugin, authentication_string from user;来查询用户中的有关信息

通过使用update user set authentication_string=password("mysqlmysql"), plugin='mysql_native_password' where user='root';来更新表中相关信息。

感谢以下博客博文的帮助。

https://www.cnblogs.com/cpl9412290130/p/9583868.html

猜你喜欢

转载自www.cnblogs.com/feiyang930112/p/11296802.html