说明:数据文件的默认存放位置为/var/lib/mysql/
1.查询是否有残留软件
复制[root@kht118 kht]
[root@kht118 kht]
mariadb-libs-5.5.65-1.el7.x86_64
[root@kht118 kht]
[root@kht118 mysql]
[root@kht118 mysql]
2.上传解压并安装
复制[root@kht118 kht]
[root@kht118 kht]
libaio-devel-0.3.109-13.el7.x86_64
libaio-0.3.109-13.el7.x86_64
[root@kht118 kht]
[root@kht118 ~]
perl-Data-Dumper-2.145-3.el7.x86_64
[root@kht118 kht]
[root@kht118 kht]
[root@kht118 kht]
[root@kht118 kht]
[root@kht118 kht]
[root@kht118 ~]
mysql.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysql on
[root@kht118 ~]
[root@kht118 ~]
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@kht118 kht]
[root@kht118 kht]
mysql> set password = password('KHTkht123456!');
mysql> use mysql;
mysql> select user,host from user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| root | kht118 |
| root | localhost |
+------+-----------+
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
mysql> flush privileges;
mysql> select user,host from user;
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | kht118 |
| root | localhost |
+------+-----------+
mysql> show VARIABLES like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | CST |
| time_zone | SYSTEM |
+------------------+--------+
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2022-11-21 10:45:17 |
+---------------------+
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫