@WillireamAngel
2018-03-09T06:26:01.000000Z
字数 911
阅读 1389
数据库
PHP+HTML基本语法
wget http://dev.mysql.com/get/mysql57-community-release-el7-20.noarch.rpm
yum localinstall mysql57-community-release-el7-20.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*" #验证安装是否成功
yum install mysql-community-server #安装MySQL
systemctl start mysqld #启动MySQL服务
systemctl status mysqld #查看MySQL启动状态
shell> systemctl enable mysqld
shell> systemctl daemon-reload #开机启动
shell> grep 'temporary password' /var/log/mysqld.log
shell> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
或者
mysql> set password for 'root'@'localhost'=password('MyNewPass4!'); ##修改root密码
mysql
设置密码:
mysqladmin -u root password "new_password";
重新登录:
[root@host]# mysql -u root -p
Enter password:*******
systemctl status mysqld
or
ps -ef | grep mysqld
启动与关闭mysql:
启动:
cd /usr/bin
./mysqld_safe &
or
systemctl start mysqld