时间:2021-07-01 10:21:17 帮助过:4人阅读
rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
安装MySQL,输入命令(过程中问询是否yes,一路y下去):
yum install mysql-community-server
安装完成后,输入命令查看MySQL版本号:
mysql -V
启动MySQL,输入命令:
service mysqld start
第一次启动比较慢,因为它会自己做初始化,耐心等待即可。 如果启动失败,提示“MySQL Daemon failed to start”,可以尝试先初始化mysql,输入命令:mysqld --initialize。 如果初始化提示: 2015-12-22T07:49:45.386095Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
service mysqld start
9、进入mysql后,第一件事件就是要你改默认密码。mysql 5.7以后,系统自动生成随机的密码,我操作时,没登录上,切换mysql到安全模式启动,自己去修改即可(安全模式修改密码,见另一篇文章:MySQL忘记密码,或:root密码重置报错:mysqladmin: connect to server at ‘localhost‘ failed的解决方案)。
[root@c12 mysql57]# ./bin/mysql -u root -p
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user root identified by ‘root‘;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
使用mysqladmin总算能改了
[root@c12 mysql57]# ./bin/mysqladmin -u root -p password
Enter password:
New password:
Confirm new password:
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc |
+-----------+
1 row in set (0.00 sec)
10、设置mysql为开机启动
chkconfig --list 显示服务列表
如果看到mysqld的服务,并且3,4,5都是on的话则成功,如果是off,则键入
chkconfig --level 345 mysqld on
reboot重启电脑
netstat -na | grep 3306,如果看到有监听说明服务启动了。也可以用:service mysqld status看状态
安装mysql 转载 的
标签:ssl eset 事件 war 数据库 reboot lease jpg star