linux mysql

enquiry mysql version in centos linux

yum list installed | grep mysql

yum -y remove mysql-libs.x86_64

enquiry mysql version in yum repository
yum list | grep mysql
or
yum -y list mysql*

install mysql again
yum -y install mysql-server mysql mysql-devel

 

start/stop/restart mysql

 

before version 5.5

service mysqld start

service mysqld stop

service mysqld restart

 

after version 5.5

service mysqld start

service mysqld stop

service mysqld restart 

 

chmod +x /etc/init.d/mysqld           #给mysql执行权限
chkconfig --add mysqld                 #把mysql注册为服务
chkconfig --level 345 mysqld on    #让mysql自启动
service mysqld start                       #启动mysql

 

create user 'hive' identified by 'hive';
grant all privileges on *.* to 'hive'@'localhost' with grant option;
grant all privileges on *.* to 'hive'@'%' with grant option;
flush privileges;

 

你可能感兴趣的:(linux)