centos6.5下使用yum安装MysqL
# rpm -qa|grep MysqL
停止MysqL服务
#service MysqLd stop
# rpm -ev --nodeps MysqLxxx
# find / -name MysqL
# rm -rf 目录
再次复查
# rpm -qa|grep MysqL
# yum list|grep MysqL
/*运行结果:*******************************************/
安装:
/*运行结果:********************************************/
..................省略部分以上内容
查看刚安装好的MysqL版本
# rpm -qi MysqL-server
/*运行结果:********************************************************************************************************************/
翻译:
启动msyql
#service MysqLd start
/*运行结果:****************************************************/
[root@kiven-centos ~]# service MysqLd start
Initializing MysqL database: WARNING: The host 'kiven-centos' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MysqL privileges !
Installing MysqL system tables...
OK
Filling help tables...
OK
------
To start MysqLd at boot time you have to copy
support-files/MysqL.server to the right place for your system
------
PLEASE REMEMBER TO SET A PASSWORD FOR THE MysqL root USER !
To do so,start the server,then issue the following commands:
/usr/bin/MysqLadmin -u root password 'new-password'
/usr/bin/MysqLadmin -u root -h kiven-centos password 'new-password'
------
Alternatively you can run:
/usr/bin/MysqL_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
------
See the manual for more instructions.
You can start the MysqL daemon with:
cd /usr ; /usr/bin/MysqLd_safe &
------
-------
Please report any problems with the /usr/bin/MysqLbug script!
/*运行结果【end】****************************************************/
翻译:
这可能意味着您的libc库并不是100%兼容的
通常情况下,主机名解析不会起作用。
这意味着你应该使用IP地址而不是主机名
在指定MysqL特权时!
安装MysqL系统表……
------
要在启动时启动MysqLd,必须复制
-------
为此,启动服务器,然后发出以下命令:
/usr/bin/MysqLadmin -u root password 'new-password'
/usr/bin/MysqLadmin -u root -h kiven-centos password 'new-password'
或者您可以运行:
/usr/bin/MysqL_secure_installation
这也可以让你选择取消测试
强烈推荐生产服务器。
---------
更多的说明请参阅手册。
您可以启动MysqL守护进程:
cd /usr ; /usr/bin/MysqLd_safe &
-----------
请报告/usr/bin/MysqLbug脚本的任何问题!
这段话的重点:
1、在安装MysqL后,会创建一个 msyqld进程
2、设置root密码 :MysqLadmin -u root password 'new-password'
重启MysqL服务器
# service MysqLd restart
Stopping MysqLd: [ OK ]
Starting MysqLd:
/*运行结果:********************************************************************************************************************/
查看MysqL状态
# service MysqLd status
MysqLd (pid 2083) is running...
/*运行结果:********************************************************************************************************************/
# chkconfig --list|grep MysqLd
MysqLd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
/*********************************************************************************************************************/
设置MysqL服务开机启动
# chkconfig MysqLd on
/***************************************************************************************/
/***************************************************************************************/
# MysqLadmin -u root password '123456'
使用root登陆MysqL
# MysqL -u root -p
查看MysqL端口号
# netstat -anp|grep 3306