Home > Database > Mysql Tutorial > body text

OEL6.3安装MYSQL5.6.10

PHPz
Release: 2019-02-26 17:19:15
Original
1186 people have browsed it

OEL6.3安装MYSQL5.6.10

相关mysql视频教程推荐:《mysql教程

1.yum install gcc* c++ * autoconf automake zlib*  libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*

安装系统所需要的库文件

2.安装cmake工具。yum install cmake*

3.由于mysql 5.6源码安装时发生了一个警告Googlemock was not found,看了一下,是新版mysql 5.6还支持了google的c++mock框架了,提示带了-DENABLE_DOWNLOADS=1可解决这个问题(就是允许下载)。

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS
Copy after login

4.下来可以在mysql-5.6.10/source_downloads这个路径下会下载一个gmock-1.6.0.zip文件, 这个文件的安装

注意:如果中途出现错误,需要重新编译,需要 删除CMakeCache.txt ,find / -name CMakeCache.txt

unzip gmock-1.6.0.zip
./configure
make
Copy after login

5>make make install 执行完后会看到安装成功的提示

6> useradd mysql 创建一个用户名为mysql的用户

7> 安装默认的数据库:

进入到cd /usr/local/mysql/scripts

./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --user=mysql
 
[root@localhost local]# chown mysql:mysql -R /usr/local/mysql/
[root@localhost local]# cd ..
[root@localhostmysql]# scripts/mysql_install_db --user=mysql
[root@localhostmysql]# cp support-files/my-default.cnf /etc/my.cnf
[root@localhostmysql]# bin/mysqld_safe --user=mysql&
[root@localhostmysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhostmysql]# chmod +x /etc/init.d/mysqld
 
[root@localhostmysql]# chkconfig --add mysqld
Copy after login

9>启动服务

service mysqld start || /etc/init.d/mysql start 添加到开机自启动( chkconfig --add mysqld)
Copy after login

10> 增加mysql的root用户的密码:

mysql -u root password 'your_password
Copy after login
Copy after login

11>在进程中查看启动的情况

ps -ef | grep mysqld
Copy after login

10> 增加mysql的root用户的密码:

mysql -u root password 'your_password
Copy after login
Copy after login

11>在进程中查看启动的情况

ps -ef | grep mysqld 		
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template