manjaro怎么启动mysql_Manjaro|配置MySql数据库

安装并初始化MySql

sudo pacman -S mysql

正在安装 mysql-clients (8.0.11-1)...

正在安装 mysql (8.0.11-1)...

:: You need to initialize the MySQL data directory prior to starting

the service. This can be done with mysqld --initialize command, e.g.:

mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

:: Additionally you should secure your MySQL installation using

mysql_secure_installation command after starting the mysqld service

初始化MySql数据目录/注意记录root临时密码

mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

查看MySql状态

sudo systemctl status mysqld

启动MySql服务/开机自启

sudo systemctl enable mysqld

sudo systemctl start mysqld

账户安全设置/需要使用root临时密码登陆

mysql_secure_installation

使用workbench连接时需要修改密码规则

#出现

caching_sha2_password cannot be loaded

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户的密码

FLUSH PRIVILEGES; #刷新权限

再重置下密码:alter user 'root'@'localhost' identified by '123qwe';

ERROR(重新安装后已解决)

Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)

● mysqld.service - MySQL database server

Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: activating (start-post) (Result: exit-code) since Sat 2018-05-26 19:41:34 CST; 18s ago

Process: 8359 ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)

Main PID: 8359 (code=exited, status=1/FAILURE); Control PID: 8360 (mysqld-post)

Tasks: 2 (limit: 4722)

Memory: 1.2M

CGroup: /system.slice/mysqld.service

├─8360 /bin/sh /usr/bin/mysqld-post

└─8560 sleep 1

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:34.907694Z 0 [Warning] [MY-010139] [Server] Changed limits: >

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:34.907742Z 0 [Warning] [MY-010142] [Server] Changed limits: >

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.121790Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', >

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.121870Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (>

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.123947Z 0 [Warning] [MY-010091] [Server] Can't create tes>

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.123965Z 0 [Warning] [MY-010159] [Server] Setting lower_ca>

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.124479Z 0 [ERROR] [MY-010172] [Server] failed to set data>

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.124653Z 0 [ERROR] [MY-010119] [Server] Aborting

5月 26 19:41:35 dexter0ion-pc mysqld[8359]: 2018-05-26T11:41:35.124793Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: >

5月 26 19:41:35 dexter0ion-pc systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE

~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值