时间:2021-07-01 10:21:17 帮助过:22人阅读
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘yourpassword‘;
9.授权其他机器远程登录
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘yourpassword‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
10.开启开机自启动 先退出mysql命令行,然后输入以下命令
systemctl enable mysqld
systemctl daemon-reload
11.设置MySQL的字符集为UTF-8,令其支持中文
vim /etc/my.cnf改成如下,然后保存
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysql] default-character-set=utf8 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock default-storage-engine=INNODB character_set_server=utf8 symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid12.重启一下MySQL,令配置生效
service mysqld restart13.防火墙开放3306端口
firewall-cmd --state firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload
14.卸载MySQL仓库 一开始的时候我们安装的yum,每次yum操作都会更新一次,耗费时间,我们把他卸载掉
rpm -qa | grep mysql
yum -y remove mysql57-community-release-el7-10.noarch
15.数据库的操作 (1)查看mysql是否启动:service mysqld status 启动mysql:service mysqld start 停止mysql:service mysqld stop 重启mysql:service mysqld restart (2)查看临时密码:grep password /var/log/mysqld.log
centos7 安装 Mysql 5.7.27,详细完整教程
标签:tsx jre mvm 保存 uri vlt pmu tfs mysql命令