Linux(DeepInOS) 下 mysql 的安装与基本配置

it2022-05-05  158

索引:

目录索引

参看代码 GitHub:

DeepIn(GNU/Linux) MySQL

一、安装

1 sudo apt-get install mysql-server 2 期间需要输入两次密码,root账户的密码 3 sudo apt-get install mysql-client

二、控制台登陆 

1 mysql -u root -p 2 输入root账户密码就可以登录了 3 quit 4 退出

三、基本编码配置

1 登陆后 2 SHOW VARIABLES LIKE 'character%'; 3 默认编码为utf-8 -- 修改/etc/mysql/my.cnf (默认安装路径下) (标签下没有的添加,有的修改) 4 [mysqld] 5 character_set_server=utf8 6 7 [mysql] 8 default-character-set=utf8 9 10 [client] 11 default-character-set=utf8

四、服务操作 

1 停止MySQL数据库服务 2 sudo systemctl stop mysql.service 3 启动MySQL数据库服务 4 sudo systemctl start mysql.service 5 重启MySQL数据库服务 6 sudo systemctl restart mysql.service

五、运行状态基本查看

1 查看MySQL运行状态 2 sudo systemctl status mysql.service 3 查看mysqld进程是否开启 4 pgrep mysqld 5 如果进程开启,命令将返回该进程的id。

六、开机自启及服务

1 这里可能chkconfig没有安装,如果是的话 ,则需要安装chkconfig命令 2 sudo apt-get install chkconfig 3 将mysql加入到系统服务 4 chkconfig --add mysql 5 将mysql设置开机启动 6 chkconfig mysql on

 

 

 

 

 

                                         蒙

                                    2018-05-05 23:30 周六

                                    2018-05-11 22:49 周五

 

转载于:https://www.cnblogs.com/Meng-NET/p/8996788.html

相关资源:各显卡算力对照表!

最新回复(0)