在linux下安装mysql
1、下载mysql
下载地址: http://dev.mysql.com/downloads/mysql/5.5.html#downloads
2、进入系统后,检测是否安装mysql
#rpm -qa | grep -i mysql
3、卸载自带的mysql
#rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64
4、安装mysql-server
#rpm -ivh /home/software/MySQL-server-5.5.48-1.el6.x86_64.rpm
5、安装mysql-client
#rpm -ivh /home/software/MySQL-client-5.5.48-1.el6.x86_64.rpm
6、启动mysql
#service mysql start
7、修改root用户的密码
#/usr/bin/mysqladmin -u root password 'new-password'
8、检查mysql是否已启动
#mysql -uroot -ppwd
从centos7开始,系统自带mariadb数据库,该数据库会和安装mysql数据库冲突,安装mysql数据库前,先卸载mariadb数据库
1、检查mariadb数据库
# rpm -qa|grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
2、卸载mariadb数据库
#rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64