centos7下安装mysql6初始化安装密码
2020-06-05 16:01:52来源:博客园 阅读 ()
centos7下安装mysql6初始化安装密码
1.先停止数据库服务器
service mysqld stop
2.vim /etc/my.cnf
3.配置文件添加skip-grant-tables
[root@VM_0_8_centos ~]# vim /etc/my.cnf # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html [mysqld] # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-grant-tables 此处!!!!!! # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
4.重启数据库
systemctl restart mysql
5.登录数据库
mysql -uroot -p
如果询问密码,直接空密码登录
6.set password for root@localhost = password('123456');括号里面的密码你自己修改。
7.mysql -uroot -p123456 登录成功
原文链接:https://www.cnblogs.com/PiaoYu/p/13047560.html
如有疑问请与原作者联系
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- 安装Zabbix5.0 2020-06-10
- windows10安装配置WSL(Ubuntu) 2020-06-07
- 在已经编译安装好php7场景下 安装php openssl扩展 2020-06-06
- 在已经编译安装好php7场景下安装curl扩展 2020-06-06
- 在已经编译安装好php7场景下,install gd库 with free-type 2020-06-06
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash