码迷,mamicode.com
首页 > 数据库 > 详细

centos 6.5 安装mysql5.5.28

时间:2015-04-01 19:24:21      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

1,useradd -s /sbin/nologin mysql
2,mkdir -p /data/mysql/data
3,chown -R mysql:mysql /data/mysql
4,yum install gcc gcc-c++ cmake ncurses-devel bison
5,wget http://ncu.dl.sourceforge.net/project/mysql.mirror/MySQL%205.5.28/mysql-5.5.28.tar.gz
6,tar xzvf mysql-5.5.28.tar.gz
7,cd mysql-5.5.28
//相当于以前的./configure
8,cmake -DMYSQL_USER=mysql -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DINSTALL_DATADIR=/data/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1
9,make && make install
10,chown -R mysql:mysql /usr/local/mysql/
11,mv /root/mysql-5.5.28/support-files/my-large.cnf /etc/my.cnf
12,mv /root/mysql-5.5.28/support-files/mysql.server /etc/init.d/mysqld
13,chmod a+x /etc/init.d/mysqld
14,chkconfig --level 345 mysqld on
15,echo "export PATH=/usr/local/mysql/bin/:$PATH" >> /etc/profile
16,source /etc/profile
17,/usr/local/mysql/scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql5.5 --datadir=/data/mysql/data
18,vim /etc/my.cnf
19,在[mysqld]处添加
basedir=/usr/local/mysql
datadir=/data/mysql/data
20,service mysqld start
21,/usr/local/mysql/bin/mysqladmin -u root password ‘123‘
22,mysql -u root -p123

====分割线====

//mysql实现远程链接 your paaaword 为你的密码 root为你的账号 %不限定连接的ip

mysql>GRANT ALL PRIVILEGES ON *.* TO root@‘%‘ IDENTIFIED BY ‘your paaaword‘; 

mysql>GRANT ALL on *.* to root@192.168.0.% IDENTIFIED BY ‘your paaaword‘;

mysql安装相关链接
http://blog.chinaunix.net/uid-26931379-id-3193926.html

centos 6.5 安装mysql5.5.28

标签:

原文地址:http://www.cnblogs.com/selectnow/p/4384300.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!