位置: 编程技术 - 正文
推荐整理分享mysql 5.7.17 安装配置方法图文教程(ubuntu 16.04)(mysql5717安装及配置超详细教程),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:mysql5717安装及配置超详细教程,mysql 5.7.24安装,mysql5717安装详细过程,mysql 5.7.24安装,mysql5717安装过程,mysql5717安装及配置超详细教程,mysql5717安装及配置超详细教程,mysql5717安装及配置超详细教程,内容如对您有帮助,希望把文章链接给更多的朋友!
在MySQL官网上下载最新版的Ubuntu Linux专用的MySQL。我这里下载的是:
mysql-server_5.7.-1ubuntu._amd.deb-bundle.tar
也可从以下mirrors下载:
命令为:
解压开来后,一共有个deb包,用sudo dpkg -i [包名]命令逐个安装,因为包与包中间存在依赖关系,这里安装有个先后顺序。
-rw-r--r-- 1 Nov : libmysqlclient_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : libmysqlclient-dev_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : libmysqld-dev_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-client_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-common_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-community_5.7.-1ubuntu._amd.changes -rw-r--r-- 1 Nov : mysql-community-client_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-community-server_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-community-source_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-community-test_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-server_5.7.-1ubuntu._amd.deb -rw-r--r-- 1 Nov : mysql-testsuite_5.7.-1ubuntu._amd.deb
我的安装的顺序是: 1.mysql-common_5.7.-1ubuntu._amd.deb 2.libmysqlclient_5.7.-1ubuntu._amd.deb 3.libmysqlclient-dev_5.7.-1ubuntu._amd.deb 4.libmysqld-dev_5.7.-1ubuntu._amd.deb
5.mysql-community-client_5.7.-1ubuntu._amd.deb 6.mysql-client_5.7.-1ubuntu._amd.deb 7.mysql-community-source_5.7.-1ubuntu._amd.deb
这里需要再安装一个依赖包叫libmecab2,安装好后,继续安装最后一个: 8.mysql-community-server_5.7.-1ubuntu._amd.deb 安装过程中需要设置数据库密码。 到这里,所有的已经安装完毕。输入Mysql -u root -p可以登陆数据库了。
root@ubuntu:/fly/mysql# dpkg -i mysql-common_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading mysql-common from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack mysql-common_5.7.-1ubuntu._amd.deb ... Unpacking mysql-common (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up mysql-common (5.7.-1ubuntu.) ... root@ubuntu:/fly/mysql# dpkg -i libmysqlclient_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading libmysqlclient:amd from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack libmysqlclient_5.7.-1ubuntu._amd.deb ... Unpacking libmysqlclient:amd (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up libmysqlclient:amd (5.7.-1ubuntu.) ... Processing triggers for libc-bin (2.-0ubuntu5) ... root@ubuntu:/fly/mysql# dpkg -i libmysqlclient-dev_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading libmysqlclient-dev from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack libmysqlclient-dev_5.7.-1ubuntu._amd.deb ... Unpacking libmysqlclient-dev (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up libmysqlclient-dev (5.7.-1ubuntu.) ... Processing triggers for man-db (2.7.5-1) ... root@ubuntu:/fly/mysql# dpkg -i libmysqld-dev_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading libmysqld-dev from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack libmysqld-dev_5.7.-1ubuntu._amd.deb ... Unpacking libmysqld-dev (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up libmysqld-dev (5.7.-1ubuntu.) ... root@ubuntu:/fly/mysql# dpkg -i mysql-community-client_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading mysql-community-client from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack mysql-community-client_5.7.-1ubuntu._amd.deb ... Unpacking mysql-community-client (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up mysql-community-client (5.7.-1ubuntu.) ... Processing triggers for man-db (2.7.5-1) ... root@ubuntu:/fly/mysql# dpkg -i mysql-client_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading mysql-client from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack mysql-client_5.7.-1ubuntu._amd.deb ... Unpacking mysql-client (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up mysql-client (5.7.-1ubuntu.) ... root@ubuntu:/fly/mysql# dpkg -i mysql-community-source_5.7.-1ubuntu._amd.deb dpkg: warning: downgrading mysql-community-source from 5.7.-1ubuntu. to 5.7.-1ubuntu. (Reading database ... files and directories currently installed.) Preparing to unpack mysql-community-source_5.7.-1ubuntu._amd.deb ... Unpacking mysql-community-source (5.7.-1ubuntu.) over (5.7.-1ubuntu.) ... Setting up mysql-community-source (5.7.-1ubuntu.) ... root@ubuntu:/fly/mysql# dpkg -i mysql-community-server_5.7.-1ubuntu._amd.deb Selecting previously unselected package mysql-community-server. (Reading database ... files and directories currently installed.) Preparing to unpack mysql-community-server_5.7.-1ubuntu._amd.deb ... Unpacking mysql-community-server (5.7.-1ubuntu.) ... Setting up mysql-community-server (5.7.-1ubuntu.) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Processing triggers for systemd (-4ubuntu) ... Processing triggers for ureadahead (0..0-) ... Processing triggers for man-db (2.7.5-1) ... root@ubuntu:/fly/mysql# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , 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>
mysql简单安装方式:
1. sudo apt-get install mysql-server
2. apt-get isntall mysql-client
3. sudo apt-get install libmysqlclient-dev
安装过程中会提示设置密码什么的,注意设置了不要忘了,安装完成之后可以使用如下命令来检查是否安装成功:
sudo netstat -tap | grep mysql
通过上述命令检查之后,如果看到有mysql 的socket处于 listen 状态则表示安装成功。
登陆mysql数据库可以通过如下命令:
mysql -u root -p
-u 表示选择登陆的用户名, -p 表示登陆的用户密码,上面命令输入之后会提示输入密码,此时输入密码就可以登录到mysql。
然后通过 show databases; 就可以查看当前的数据库。
我们选择 mysql数据库就行下一步操作,使用use mysql 命令,显示当前数据库的表单:show tables
mysql下如何执行sql脚本
dpkg安装出现的问题:
安装mysql server时产生软件依赖问题: mysql-community-server depends on apparmor; however: Package apparmor is not installed. mysql-community-server depends on libmecab2 (>= 0.-1.2ubuntu1); however: Package libmecab2 is not installed. 那就先安装上: sudo apt -get install libmecab2 然后mysql-community-server,mysql-server就能正常使用了
在ubuntu下安装任何软件都提示以下错误:
You might want to run 'apt-get -f install' to correct these:The following packages have unmet dependencies: kate : Depends: kdelibs4c2a (>= 4:3.5.9) but it is not going to be installed Depends: libqt3-mt (>= 3:3.3.8b) but it is not going to be installed Recommends: kregexpeditor but it is not installable kscope : Depends: kdelibs4c2a (>= 4:3.5.7-1) but it is not going to be installed Depends: libaudio2 but it is not going to be installed Depends: libqt3-mt (>= 3:3.3.8really3.3.7) but it is not going to be installed Depends: cscope but it is not going to be installed Depends: exuberant-ctags but it is not going to be installed Depends: graphviz but it is not going to be installedE: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
解决方法:
删除提示的kate和kscope两个未完全安装的软件。
精彩专题分享:mysql不同版本安装教程 mysql5.7各版本安装教程 mysql5.6各版本安装教程
友情链接: 武汉网站建设