准备环境:Centos6.5(6系列操作系统)[root@localhost ~]# yum -y install GCc gcc-c++ ncurses-devel libxml2-devel zlib-
[root@localhost ~]# yum -y install GCc gcc-c++ ncurses-devel libxml2-devel zlib-devel pcre-devel
[root@localhost ~]# tar zxvf bison-2.5.tar.gz
[root@localhost ~]# cd bison-2.5
[root@localhost ~]# ./configure &&make &&make install
[root@localhost ~]# tar zxvf cmake-2.8.7.tar.gz
[root@localhost ~]# cd cmake-2.8.7
[root@localhost ~]# ./bootstrap &&gmake &&gmake install
[root@localhost ~]# tar zxvf Mysql-5.5.22.tar.gz
[root@localhost ~]# cd mysql-5.5.22
[root@localhost ~]# useradd mysql
[root@localhost ~]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATioN=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DSYSCONFDIR=/etc/ &&make &&make install
参数注释:安装目录、默认编码、校验字符集、安装所有扩展字符集、配置文件目录
[root@localhost ~]# chown -R :mysql /usr/local/mysql
[root@localhost ~]# cd /usr/local/mysql/support-files
[root@localhost ~]# cp my-medium.cnf /etc/my.cnf
[root@localhost ~]# cp mysql.server /etc/init.d/mysqld
[root@localhost ~]# cd ../scripts/
下面操作将进行mysql初始化,指定基础目录,存放数据目录,及运行用户
[root@localhost ~]# ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
[root@localhost ~]# /etc/init.d/mysqld start
[root@localhost ~]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[root@localhost ~]# source /etc/profile
[root@localhost ~]# mysqladmin -u root password 'redhat' 设置mysql运行账户及密码,这个root可不是系统用户的root哦!
[root@localhost ~]# mysql -u root -p
Enter passWord:
OK,安装完成
--结束END--
本文标题: 编译安装Mysql5.5数据库软件
本文链接: https://lsjlt.com/news/44400.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0