mysql 5.5 安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 5.5 安装相关的知识,希望对你有一定的参考价值。
==============安装mysql======================
yum install libaio-devel ncurses -y
===========================================
mkdir /opt/tools -p
cd /opt/tools
groupadd mysql
useradd -s /sbin/nologin -M mysql -g mysql
tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz
mv mysql-5.5.32-linux2.6-x86_64 /opt/mysql-5.5.32
ln -s /opt/mysql-5.5.32/ /opt/mysql
chown -R mysql.mysql /opt/mysql/
cd /opt/mysql
/opt/mysql/scripts/mysql_install_db --basedir=/opt/mysql/ --datadir=/opt/mysql/data/ --user=mysql
/bin/cp /opt/mysql/support-files/my-small.cnf /etc/my.cnf
sed -i 's#/usr/local/mysql#/opt/mysql#g' /opt/mysql/bin/mysqld_safe
/opt/mysql/bin/mysqld_safe &
echo "PATH="/opt/mysql/bin:$PATH"" >>/etc/profile
source /etc/profile
cp support-files/mysql.server /etc/init.d/mysqld
sed -i 's#/usr/local/mysql#/opt/mysql#g' /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
killall mysqld
/etc/init.d/mysqld start
netstat -lntup |grep mysql
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list mysqld
echo "/etc/init.d/mysqld start" >>/etc/rc.local
安装完毕
======================================================
#mysql
show databases;
select user();
exit
# mysqladmin -u root password '密码'
# mysql -uroot -p
select user,host from mysql.user;
设置root密码完毕
==========================================================
grant all PRIVILEGES on *.* to 用户@'%' identified by '密码';
#授权用户kaitaiming对所有库所有的权限
flush privileges;
以上是关于mysql 5.5 安装的主要内容,如果未能解决你的问题,请参考以下文章