01-MySQL Linux安装

一、检查当前系统是否安装过mysql

rpm -qa|grep mysql
或 ps -ef|grep mysql

二、安装mysql服务端

rpm -ivh MySQL-server-5.5.48-1.linux2.6.i386.rpm   

CentOS07安装MySQL错误:依赖检测失败

CentOS安装mysql*.rpm提示conflicts with file from package的解决办法

根据安装提示设置密码

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h hadoop102 password '123456'  

三、安装mysql客户端

rpm -ivh MySQL-client-5.5.48-1.linux2.6.i386.rpm 

四、查看mysql安装时创建的用户和组

cat /etc/passwd|grep mysql
cat /etc/group|grep mysql
mysqladmin --version

五、mysql服务的启动、停止 

service mysql start
service mysql stop  

六、设置mysql服务开机自启动

chkconfig mysql on
chkconfig --list | grep mysql
ntsysv   --看到[*]mysql这一行,表示开机后会自动启动mysql

七、查看mysql安装路径

ps -ef|grep mysql

八、启停相关脚本

/etc/init.d/mysql    

九、修改默认配置文件

 cp /usr/share/mysql/my-huge.cnf /etc/my.cnf  

十、查看、修改字符集

show variables like 'character%' ;

[client]
default-character-set=utf8

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci

[mysql]
default-character-set=utf8

  

  

 

 

new  [njuː]  详细X
基本翻译
adj. 新的,新鲜的;更新的;初见的
adv. 新近
n. (New)人名;(英)纽
网络释义
new: 新的
New Hampshire: 新罕布什尔州

 

posted @ 2019-07-15 00:16  与君共舞  阅读(161)  评论(0编辑  收藏  举报