0x00 踩到的坑 sudo apt-get install mysql-server-5.7 报错,各种要求依赖包。
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-server-5.7 : Depends: mysql-client-5.7 (>= 5.7.17-0ubuntu0.16.04.1) but it is not going to be installed
Depends: mysql-server-core-5.7 (= 5.7.17-0ubuntu0.16.04.1) but it is not going to be installed
Depends: libevent-core-2.0-5 (>= 2.0.10-stable) but it is not installable
Recommends: libhtml-template-perl but it is not installable
E: Unable to correct problems, you have held broken packages.
心一横,干脆全部更新得了,简单又粗暴
1. sudo apt-get update
0x01 安装mysql
1. sudo apt-get install mysql-server
2. sudo apt-get isntall mysql-client
3. sudo apt-get install libmysqlclient-dev
中间需要手动输入root的登入密码!!切记,一定要记住这个密码!!!!!!!
0x03 登入数据库
我这里使用的xshell方便写博客时候复制,xshell登入linux使用mysql,需要切换到root权限下:
1. sudo su
reacher@ubuntu:~$ sudo su
[sudo] password for reacher:
root@ubuntu:/home/reacher# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
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>