安装 MySQL5
groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-5.0.32.tar.gz
cd mysql-5.0.32
./configure -prefix=/usr/local/mysql -enable-assembler -with-mysqld-ldflags=-all-static -with-extra-charsets=all -with-big-tables -with-charset=utf8 -with-collation=utf8_unicode_ci make make install cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf cd /usr/local/mysql/ bin/mysql_install_db -user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
/////////////////////// 自己使用的方法
./configure -prefix=/usr/local/mysql -enable-assembler -with-mysqld-ldflags=-all-static -
with-extra-charsets=all -with-big-tables -with-charset=utf8 -with-collation=utf8_unicode_ci
make
make install
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
./usr/local/mysql/bin/mysql_install_db --user=mysql
cd /usr/local/
chown -R mysql.mysql mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
/////////////////////////////
启动服务: /usr/local/mysql/share/mysql/mysql.server start (启动start 关闭stop 重启restart)
键入mysql回车就可已看到欢迎界面。
说明我们已成功安装了mysql
顺便改一下密码
cd /usr/local/mysql/bin
./mysqladmin -u root -p password “123456″
再改一下mysql最大连接数
vi /etc/my.cnf
在里面添加 max_connections = 1000
:wq!
保存,重启mysql
然后用命令: mysqladmin -uroot -p variables
输入root数据库账号的密码后可看到
| max_connections | 1000 |
说明:
-with-extra-charsets=all 对多语言支持
-with-unix-socket-path=/usr/local/mysql/var/mysql.sock 这个是指定mysql服务启动后。
联机套接字文件所处的位置和文件名,也就是说,如果mysql服务器成功启动后,就能在 /usr/local/mysql/var.采用这一选项,通常会出错,建议不配置用默认的。
默认会在/tmp/mysql.sock. 目录中看到mysql.sock文件。
============================