【国产化环境】飞腾cpu银河麒麟V10系统apt-get方式安装最新mysql

**

打开终端

**
输入密码切换到root身份

sudo -i

更新apt源

apt-get update 

安装mysql

apt-get install mysql-server

检查mysql的状态

systemctl status mysql.service
mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-12-20 18:15:45 CST; 38s ago
    Process: 255962 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 255970 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 4588)
     Memory: 352.8M
        CPU: 2.455s
     CGroup: /system.slice/mysql.service
             └─255970 /usr/sbin/mysqld


 
1220 18:15:43 lhdpc systemd[1]: Starting MySQL Community Server...
1220 18:15:45 lhdpc systemd[1]: Started MySQL Community Server.

状态已是运行中
说明:安装完成后mysql的配置文件位于:

/etc/mysql/mysql.conf.d/mysqld.cnf

mysql初始化

mysql_secure_installation

会有一系列的问题回答:

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
 
Press y|Y for Yes, any other key for No: n

是否做密码的强度校验?选n,生产环境中建议设置一个高强度的密码

Please set the password for root here.
 
New password:
 
Re-enter new password: 

在此处输入两次mysql的root账号密码

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Success. 

此处输入Y,用来删除匿名用户

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N
 
... skipping.

是否禁止root账号远程连接,选n,允许远程连接

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : n

是否删除test数据库,选n,不删,留着

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.

是否重新加载权限表,选Y,加载

测试效果:用刚才设置的root密码登录

 mysql -u root -p


Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.27-0ubuntu0.21.10.1 (Ubuntu)
 
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

听风看月_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值