个人mysql安装配置文件

2021年11月22日 阅读数:4
这篇文章主要向大家介绍个人mysql安装配置文件,主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。
tar zxvf mysql-5.1.35.tar.gz
cd mysql-5.1.35
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=utf8,gb2312,big5 --enable-thread-safe-client
 
./configure -prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=utf8,gb2312,big5 --enable-thread-safe-client --with-plugins=innobase
 
make
make install
cp /home/soft/my.cnf /etc/my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
scripts/mysql_install_db --user=mysql
chkconfig --add mysqld
chkconfig --level 123456 mysqld on
安装完之后要初始化数据库
cd /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql
/usr/local/mysql/bin/mysqld_safe  --user=root&
                        /home/soft/mysql-
5.1.35/scripts/mysql_install_db --user=mysql
chown -R mysql var
chgrp -R mysql .
启动mysql
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start
或/usr/local/mysql/share/mysql/mysql.server start
ss -ant | grep 3306
为了能让系统找到mysql,请运行以下命令
vi /etc/profile
增长
export PATH=$PATH:/usr/local/mysql/bin
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig