[root@lly ~]# tar zxvf mysql-5.6.10.tar.gz -C /usr/local/src/
[root@lly ~]# cd /usr/local/src/mysql-5.6.10/
[root@lly mysql-5.6.10]# less INSTALL-SOURCE
mysql的使用说明
安装mysql的时候需要用到cmake工具安装cmake
[root@lly ~]# tar -zxvf cmake-2.8.10.2.tar.gz -C /usr/local/src/
[root@lly ~]# cd /usr/local/src/cmake-2.8.10.2/
[root@lly cmake-2.8.10.2]# ./configure --prefix=/usr/local/cmake
[root@lly cmake-2.8.10.2]# make && make install
Waiting.......................
[root@lly cmake-2.8.10.2]# cd /usr/local/cmake/
为了日后能快速访问cmake下的bin,把cmke下的bin添加路径
[root@lly cmake]# vim /etc/profile
注意:只有下次进入之后路径才会添加成功
[root@lly ~]# cd /usr/local/src/mysql-5.6.10/
86:36
[root@lly mysql-5.6.10]# cmake .
[root@lly mysql-5.6.10]# make && make install
Please waiting for a long time。。。。。。。。。。。。。。。。。。。。。。。。。。
[root@lly ~]# cd /usr/local/src/mysql-5.6.10/
[root@lly mysql-5.6.10]# less INSTALL-SOURCE
Mysql安装说明中的配置的步骤
[root@lly mysql-5.6.10]# cd /usr/local/mysql/
创建帐号信息
[root@lly mysql]# groupadd mysql
[root@lly mysql]# useradd -r -g mysql mysql
[root@lly mysql]# chown -R mysql .
进行初始化
[root@lly mysql]# scripts/mysql_install_db --user=mysql
[root@lly mysql]# chown -R root .
[root@lly mysql]# chown -R mysql data
[root@lly mysql]# cd support-files/
[root@lly support-files]# cp my-default.cnf /etc/my.cnf
[root@lly support-files]# cp mysql.server /etc/init.d/mysqld
[root@lly support-files]# chmod a+x /etc/init.d/mysqld
[root@lly support-files]# service mysqld start
Starting MySQL..... [ OK ]
mysqld 服务成功启动
[root@lly support-files]# netstat -tupln |grep mysqld
tcp 0 0 :::3306 :::*
[root@lly support-files]# cd ..
[root@lly mysql]# pwd
/usr/local/mysql
[root@lly mysql]# vim /etc/profile
重新登录一次
[root@lly ~]# mysql
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
[root@lly ~]# mysqladmin -u root -p password '123'设置一个管理员帐号密码123
[root@lly ~]# mysql -u root -p以后就可以以此帐号登陆了
mysql生成的/usr/local/mysql/lib库文件不是标准路径系统无法识别(/lib 或者/usr/lib为标准路径)所以需做如下配置
[root@lly mysql]# vim /etc/ld.so.conf.d/mysql.conf
写入
/usr/local/mysql/lib
刷新ld.so.cache
[root@lly mysql]# ll /etc/ld.so.cache
-rw-r--r-- 1 root root 81871 Apr 13 08:17 /etc/ld.so.cache
[root@lly mysql]# ldconfig
[root@lly mysql]# ll /etc/ld.so.cache
-rw-r--r-- 1 root root 82128 Apr 13 15:46 /etc/ld.so.cache
对mysql的头文件include做一个连接
[root@lly mysql]# ln -s /usr/local/mysql/include/ /usr/include/mysql