CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS5.5+MySQL5.6.33大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

下载MySQL-server-5.6.33-1.rHel5.x86_64.rpm与MySQL-client-5.6.33-1.rHel5.x86_64.rpm http://dev.mysql.com/downloads/file/?id=464994 http://dev.mysql.com/downloads/file/?id=465025   在/usr/local/src/下创建mysql

下载MysqL-server-5.6.33-1.rHel5.x86_64.rpm与MysqL-client-5.6.33-1.rHel5.x86_64.rpm

http://dev.mysql.com/downloads/file/?id=464994

http://dev.mysql.com/downloads/file/?id=465025

在/usr/local/src/下创建MysqL目录
[root@localhost src]# mkdir MysqL
将两个rpm文件拷贝MysqL目录下,进行安装:

[root@localhost MysqL]# rpm -ivh MysqL-server-5.6.33-1.rHel5.x86_64.rpm

[root@localhost MysqL]# rpm -ivh MysqL-client-5.6.33-1.rHel5.x86_64.rpm

安装后,启动MysqL

[root@localhost MysqL]# /etc/init.d/MysqL start
StarTing MysqL. [ OK ]
成功启动

使用root登录MysqL

[root@localhostbin]# MysqL -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:NO)

查看/root/.MysqL_secret文件,找到临时密码

[root@localhostbin]# cat /root/.MysqL_secret
# The random password set for the root user at Mon Oct 10 18:25:50 2016 (localtimE): Li9uM0_VvslGmjt8

#The random password set for the root user at Mon Oct 10 18:53:29 2016 (localtimE): EQnYTpOworiyqym6

[root@localhostbin]# MysqL -u root -p EQnYTpOworiyqym6##临时密码

Enterpassword:EQnYTpOworiyqym6##临时密码

提示密码过期

处理方法

打开/root/.MysqL_secret文件添加一个随机密码:Abcd1234

[root@localhostbin]# sudo cat /root/.MysqL_secret
# The random password set for the root user at Mon Oct 10 18:25:50 2016 (localtimE): Li9uM0_VvslGmjt8

#The random password set for the root user at Mon Oct 10 18:53:29 2016 (localtimE): EQnYTpOworiyqym6
Abcd1234
[root@localhost bin]# MysqL -uroot -p Abcd1234
Enter password:
ERROR 1049 (42000): UnkNown database 'Abcd1234'
提示Abcd1234数据库不存在,果断将'Abcd1234'修改'MysqL',保存退出

进行下列操作,修改root用户的密码

1.停止服务

[root@localhostbin]# /etc/init.d/MysqL stop

ShutTingdown MysqL.. [ OK ]

2.进入MysqLd_safe

[root@localhostbin]# MysqLd_safe --skip-grant-tables & ##屏幕打印下列信息
[1] 32329
[root@localhost bin]# 161010 19:47:50 MysqLd_safe Logging to'/var/lib/MysqL/localhost.localdomain.err'.
161010 19:47:50 MysqLd_safe StarTing MysqLd daemon with databases from/var/lib/MysqL
//在此光标处输入如下命令:

MysqL--user root MysqL

//屏幕打印如下信息:

Readingtable information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcometo the MysqL monitor. Commands end with ; or \g.
Your MysqL connection id is 1
Server version: 5.6.33 MysqL Community Server (GPL)

Copyright(C) 2000,2016,Oracle and/or its affiliates. All rights reserved.

Oracleis a registered Trademark of Oracle Corporation and/or its
affiliates. Other names may be Trademarks of their respective
owners.

Type'Help;' or '\h' for Help. Type '\c' to clear the current input statement.

MysqL>##证明成功登录

3.修改root用户的密码

MysqL>SELECT* FROM user; ##之后更新root用户的密码

MysqL>updateuser SET password = passworD('root') WHERE User = 'root';

MysqL>flushprivileges;

MysqL>exit;

4.再次使用root登录,密码root

[root@localhostbin]# MysqL -u root -p

Enterpassword:

Welcometo the MysqL monitor. Commands end with; or \g.

YourMysqL connection id is 8

Serverversion: 5.6.33 MysqL Community Server (GPL)

Copyright(C) 2000,Oracle and/or its affiliates. All rights reserved.

Oracleis a registered Trademark of Oracle Corporation and/or its

affiliates.Other names may be Trademarks of their respective

owners.

Type'Help;' or '\h' for Help. Type '\c' to clear the current input statement.

MysqL> ##登录成功

大佬总结

以上是大佬教程为你收集整理的CentOS5.5+MySQL5.6.33全部内容,希望文章能够帮你解决CentOS5.5+MySQL5.6.33所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。