linux x64 mysql 安装_Linux安装MySql

本文记录Linux安装MySql过程。

环境:OS:Centos 6.5 x64 & MySql 5.1 x64

1、系统检查

检查是否已经安装MySql数据库。[root@master ~]# rpm -qa | grep mysql

如果有安装,先卸载已经安装的MySql数据库。[root@master ~]# rpm -e mysql  //普通删除模式[root@master ~]# rpm -e --nodeps mysql  //强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

2、安装数据库[root@master ~]# yum install -y mysql-server mysql mysql-devel

查看安装情况[root@master ~]# rpm -qi mysql-serverName: mysql-server Relocations: (not relocatable)Version : 5.1.73Vendor: CentOSRelease : 3.el6_5 Build Date: 2014年02月13日 星期四 03时42分39秒Install Date: 2014年04月17日 星期四 19时38分28秒Build Host: c6b9.bsys.dev.centos.orgGroup : Applications/DatabasesSource RPM: mysql-5.1.73-3.el6_5.src.rpmSize: 25882723 License: GPLv2 with exceptionsSignature : RSA/SHA1, 2014年02月13日 星期四 03时48分08秒, Key ID 0946fca2c105b9dePackager: CentOS BuildSystem URL : http://www.mysql.comSummary : The MySQL server and related filesDescription :MySQL is a multi-user, multi-threaded SQL database server. MySQL is aclient/server implementation consisting of a server daemon (mysqld)and many different client programs and libraries. This package containsthe MySQL server and some accompanying files and directories.

3、管理数据库

启动数据库[root@master ~]# service mysqld start初始化 MySQL 数据库: Installing MySQL system tables...OKFilling help tables...OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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 master password 'new-password'Alternatively you can run:/usr/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default.This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd /usr ; /usr/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.plcd /usr/mysql-test ; perl mysql-test-run.plPlease report any problems with the /usr/bin/mysqlbug script![确定]正在启动 mysqld: [确定]

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值