libevent mysql_deeplin中MySQL服务的相关配置(乔伟)

首先我们需要在Linux操作系统里安装MySQL的服务:

输入命令:apt-get install mysql-server mysql-client

root@qiaowei-PC:/# apt-get install mysql-server mysql-client

正在读取软件包列表... 完成

正在分析软件包的依赖关系树

正在读取状态信息... 完成

将会同时安装下列软件:

libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-6 libfcgi-perl

libhtml-template-perl libmecab2 mysql-client-5.7 mysql-client-core-5.7mysql-common mysql-server-5.7 mysql-server-core-5.7建议安装:

libipc-sharedcache-perl mailx tinyca

下列【新】软件包将被安装:

libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-6 libfcgi-perl

libhtml-template-perl libmecab2 mysql-client mysql-client-5.7mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7mysql-server-core-5.7升级了0 个软件包,新安装了 13 个软件包,要卸载 0 个软件包,有 0个软件包未被升级。

需要下载0 B/21.7MB 的归档。

解压缩后会消耗163MB 的额外空间。

您希望继续执行吗? [Y/n] y

正在预设定软件包 ...

正在选中未选择的软件包 mysql-common。

(正在读取数据库 ... 系统当前共安装有187699个文件和目录。)

正准备解包 .../0-mysql-common_5.8+1.0.4_all.deb ...

正在解包 mysql-common (5.8+1.0.4) ...

正在选中未选择的软件包 mysql-client-core-5.7。

正准备解包 .../1-mysql-client-core-5.7_5.7.21-1_amd64.deb ...

正在解包 mysql-client-core-5.7 (5.7.21-1) ...

正在选中未选择的软件包 mysql-client-5.7。

正准备解包 .../2-mysql-client-5.7_5.7.21-1_amd64.deb ...

正在解包 mysql-client-5.7 (5.7.21-1) ...

正在选中未选择的软件包 mysql-server-core-5.7。

正准备解包 .../3-mysql-server-core-5.7_5.7.21-1_amd64.deb ...

正在解包 mysql-server-core-5.7 (5.7.21-1) ...

正在选中未选择的软件包 libevent-core-2.1-6:amd64。

正准备解包 .../4-libevent-core-2.1-6_2.1.8-stable-4_amd64.deb ...

正在解包 libevent-core-2.1-6:amd64 (2.1.8-stable-4) ...

正在选中未选择的软件包 libmecab2:amd64。

正准备解包 .../5-libmecab2_0.996-6_amd64.deb ...

正在解包 libmecab2:amd64 (0.996-6) ...

正在设置 mysql-common (5.8+1.0.4) ...

update-alternatives: 使用 /etc/mysql/my.cnf.fallback 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)

正在选中未选择的软件包 mysql-server-5.7。

(正在读取数据库 ... 系统当前共安装有187870个文件和目录。)

正准备解包 .../0-mysql-server-5.7_5.7.21-1_amd64.deb ...

正在解包 mysql-server-5.7 (5.7.21-1) ...

正在选中未选择的软件包 libcgi-pm-perl。

正准备解包 .../1-libcgi-pm-perl_4.38-1_all.deb ...

正在解包 libcgi-pm-perl (4.38-1) ...

正在选中未选择的软件包 libfcgi-perl。

正准备解包 .../2-libfcgi-perl_0.78-2+b2_amd64.deb ...

正在解包 libfcgi-perl (0.78-2+b2) ...

正在选中未选择的软件包 libcgi-fast-perl。

正准备解包 .../3-libcgi-fast-perl_1%3a2.13-1_all.deb ...

正在解包 libcgi-fast-perl (1:2.13-1) ...

正在选中未选择的软件包 libhtml-template-perl。

正准备解包 .../4-libhtml-template-perl_2.97-1_all.deb ...

正在解包 libhtml-template-perl (2.97-1) ...

正在选中未选择的软件包 mysql-client。

正准备解包 .../5-mysql-client_5.7.21-1_all.deb ...

正在解包 mysql-client (5.7.21-1) ...

正在选中未选择的软件包 mysql-server。

正准备解包 .../6-mysql-server_5.7.21-1_all.deb ...

正在解包 mysql-server (5.7.21-1) ...

正在设置 libevent-core-2.1-6:amd64 (2.1.8-stable-4) ...

正在设置 mysql-server-core-5.7 (5.7.21-1) ...

正在设置 libmecab2:amd64 (0.996-6) ...

正在处理用于 libc-bin (2.27-3) 的触发器 ...

正在处理用于 systemd (238-5) 的触发器 ...

正在设置 libcgi-pm-perl (4.38-1) ...

正在处理用于 man-db (2.8.3-2) 的触发器 ...

正在设置 mysql-client-core-5.7 (5.7.21-1) ...

正在设置 libfcgi-perl (0.78-2+b2) ...

正在设置 libhtml-template-perl (2.97-1) ...

正在设置 libcgi-fast-perl (1:2.13-1) ...

正在设置 mysql-client-5.7 (5.7.21-1) ...

正在设置 mysql-client (5.7.21-1) ...

正在设置 mysql-server-5.7 (5.7.21-1) ...

update-alternatives: 使用 /etc/mysql/mysql.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)

Renaming removed key_buffer and myisam-recover options (ifpresent)123456

123456Created symlink/etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.

正在设置 mysql-server (5.7.21-1) ...

正在处理用于 systemd (238-5) 的触发器 ...

这样的会就表示我们安装完成了!

那么接下来就可以输入:mysql

注意:由于我们默认的时候MySQL在deepin的环境下是没有密码的所以直接就可以进去了

root@qiaowei-PC:/# mysql

Welcome to the MySQL monitor. Commands end with ;or \g.

Your MySQL connection idis 2Server version:5.7.21-1(Debian)

Copyright (c)2000, 2018, Oracle and/orits affiliates. All rights reserved.

Oracleis a registered trademark of Oracle Corporation and/orits

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.03sec)

mysql> exitBye

那么接下来就是我们需要设置一个密码了!首先静茹数据库

>mysql

>show databases;

mysql>show databases;+--------------------+| Database |+--------------------+| information_schema |

| mysql |

| performance_schema |

| sys |+--------------------+

4 rows in set (0.03 sec)

这样我们就看到4张数据表了我们使用MySQL

>use mysql;

mysql>use mysql

Reading table information for completion of tableandcolumn names

You can turn off this feature to get a quicker startup with-A

Database changed

mysql>show tables;+---------------------------+| Tables_in_mysql |+---------------------------+| columns_priv |

| db |

| engine_cost |

| event |

| func |

| general_log |

| gtid_executed |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| innodb_index_stats |

| innodb_table_stats |

| ndb_binlog_index |

| plugin |

| proc |

| procs_priv |

| proxies_priv |

| server_cost |

| servers |

| slave_master_info |

| slave_relay_log_info |

| slave_worker_info |

| slow_log |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |+---------------------------+

31 rows in set (0.00 sec)

我们需要使用user表,因为该表里面存储了很多你的用户个人信息

接下来是非常重要的信息了!

我们要改密码了:语法是 update user set plugin="mysql_native_password" where user="用户名";

该句可以更改用户名默认是root

update user set authentication_string=password("密码") where user="用户名";

该句可以把上面的用户的密码重新设置一下

mysql> update user set plugin="mysql_native_password" where user="root";

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> update user set authentication_string=password("123456") where user="root";

Query OK, 1 row affected, 1 warning (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 1

这样就可以所完成了

最后我们使用登录就可以啦!

qiaowei@qiaowei-PC:~/Desktop$ mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ;or \g.

Your MySQL connection idis 4Server version:5.7.21-1(Debian)

Copyright (c)2000, 2018, Oracle and/orits affiliates. All rights reserved.

Oracleis a registered trademark of Oracle Corporation and/orits

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> exitBye

mysql -u 用户名 -p 密码

我们可以使用这段语句来登录MySQL数据库服务

ok了!第一次写博客有点紧张          哈哈哈

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值