爱玩科技网
您的当前位置:首页Ubuntu下安装Mysql 与Phpmyadmin

Ubuntu下安装Mysql 与Phpmyadmin

来源:爱玩科技网

Ubuntu下安装Mysql

安装过程中会出现提示设置root账户的用户名以及密码,按照提示来即可。输入以下命令可以查看mysql监听端口来检查MySQL是否安装成功。sudo netstat -tap | grep mysql

yang@yang-K45VD:~$ sudo netstat -tap | grep mysql
tcp        0      0 localhost:mysql         *:*                     LISTEN      6688/mysqld     
yang@yang-K45VD:~$ 

复制代码

尝试登录mysqlmysql -u root -p 输入密码登录

yang@yang-K45VD:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
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> 

复制代码

此时已经可以看到安装并登录成功了。

在 Linux 中可视化的 mysql 客户端我选择 phpmyadmin 下面介绍 phpmyadmin 的安装以及配置

安装 phpmyadmin

sudo apt-get install phpmyadmin

The mbstring extension is missing.
复制代码

因为缺少了 php 的 mbstring 拓展,这里我找到了一份解决方案,我测试是有效的。这里是: 具体的配置文件位置可能会和你 php 的版本不同会有所差异,我的版本是 7.0 的版本 mods-available 的位置如下 /etc/php/7.0/mods-available 取消 json.ini 文件的 priority=20 前面的注释(注意文件修改权限)。重启 Apache 然后再在浏览器里访问 http://localhost/phpmyadmin/ 即可。

因篇幅问题不能全部显示,请点此查看更多更全内容