码迷,mamicode.com
首页 > 数据库 > 详细

mysql 5.5 安装

时间:2018-04-22 18:09:02      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:mysql mysql安装

==============安装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 安装

标签:mysql mysql安装

原文地址:http://blog.51cto.com/guoshaoliang789/2106527

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!