linux安装mysql

网友投稿 539 2022-11-18

linux安装mysql

linux安装mysql

-rpm源 MySQL Yum Repository

wget ​​找到的,本人选择第一个。

安装rpm源 MySQL Yum Repository

sudo yum localinstall mysql80-community-release-el7-1.noarch.rpm

安装mysql

sudo yum install mysql-community-server

如果失败就再安装一次直到安装成功为止

启动mysql

systemctl start mysqld

查看mysql状态

systemctl status mysqld

关闭mysql

systemctl stop mysqld

修改密码

跳过密码登录

vim /etc/my-f// 在[mysqld]后面任意一行添加“skip-grant-tables”用来跳过密码验证的过程,[mysqld]skip-grant-tables

重启myql登录mysql设置密语

mysqladmin -uroot -p12345678; password 12345678mysql -uroot -p

修改密码方式2

Open & Edit /etc/my-fAdd skip-grant-tables under [mysqld]Restart MysqlYou should be able to login to mysql now using the below command mysql -u root -pRun mysql> flush privileges;Set new password by ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘NewPassword’;Go back to /etc/my-f and remove/comment skip-grant-tablesRestart MysqlNow you will be able to login with the new password mysql -u root -p注意设置密码的时候要字母大小写,数字,特殊字符都要加上。不然会报

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

错误

参考文章

​​https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost/49080720​​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:畅通工程再续
下一篇:腾讯一面总结
相关文章

 发表评论

暂时没有评论,来抢沙发吧~