Ubuntu 14.04下安装MySQL

2014-11-24 17:22:09 · 作者: · 浏览: 0

Ubuntu 14.04下安装MySQL


执行该命令后,系统还会自动安装其它的一些软件,在安装过程中会提示输入mysql的登入密码。


Ubuntu 14.04下安装MySQL


使用Tab键选择确定


Ubuntu 14.04下安装MySQL


上图,要输入两次密码,我这里就输入v,测试用吗。简单点,记住,后面要用到。

如果系统版本不一样,提示的方式可能不一样,不过总体来说都差不多。安装好后,执行命令


Ubuntu 14.04下安装MySQL


结果出现错误,Google了半天,结果越来越没耐心,这时候翻了翻自己买的书籍,输入了下面的命令


Ubuntu 14.04下安装MySQL


其中第一个mysql是命令,-uroot是指定用户为root,-pv是输入登入密码,v是密码,如果你设置的密码是别的,就换成自己安装时设置的密码,切记密码和-p之间不要有空格,不然会失败的。下面是我成功登入后,查看当前所有存在的数据库


linuxidc@ubuntu:~$ mysql -uroot -pv
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 44
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)


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>