BashOnWindow安装mysql
1、下载mysql 服务器和客户端
sudo apt-get install mysql-server mysql-client
其中过程会让输入用户名和密码
2、启动mysql服务
sudo service mysql start
在启动服务的时候,老是出现启动失败
* Starting MySQL database server mysqld [fail]
进入数据库时出现,连接有问题
mysql -uroot -p
Enter password:
ERROR (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
网上对于这个问题的答案层出不穷,在这里学会了看服务日志,error.log
zhaopei@DESKTOP-4SBBGG9:~$ cd /var/log/mysql/
2017-07-20T08:28:59.628936Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-07-20T08:29:00.523171Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-07-20T08:29:00.849139Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-07-20T08:29:00.849668Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-07-20T08:29:01.374628Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-07-20T08:29:01.445353Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 424 ...
2017-07-20T08:29:03.377758Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-07-20T08:29:03.377869Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-07-20T08:29:03.377913Z 0 [Note] InnoDB: Uses event mutexes
2017-07-20T08:29:03.377955Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-07-20T08:29:03.377990Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-07-20T08:29:03.378022Z 0 [Note] InnoDB: Using Linux native AIO
2017-07-20T08:29:03.843214Z 0 [Note] InnoDB: Number of pools: 1
2017-07-20T08:29:04.209355Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-07-20T08:29:04.319753Z 0 [ERROR] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
2017-07-20T08:29:04.321070Z 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2017-07-20T08:29:04.321134Z 0 [Warning] InnoDB: Linux Native AIO disabled.
2017-07-20T08:29:04.362427Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-07-20T08:29:04.509850Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-07-20T08:29:04.722843Z 0 [Note] InnoDB: page_cleaner coordinator priority: -20
2017-07-20T08:29:04.916626Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-07-20T08:29:06.327288Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-07-20T08:29:06.354940Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-07-20T08:29:06.620314Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-07-20T08:29:06.634545Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-07-20T08:29:06.636112Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-07-20T08:29:06.647838Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-20T08:29:06.720627Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-20T08:29:06.786791Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2536366
2017-07-20T08:29:06.792654Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-07-20T08:29:07.079595Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-07-20T08:29:08.155498Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170720 16:29:08
2017-07-20T08:29:08.589818Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-07-20T08:29:08.590045Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2017-07-20T08:29:08.590235Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2017-07-20T08:29:08.590341Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2017-07-20T08:29:08.590433Z 0 [ERROR] Can't start server: Bind on TCP/IP port: Permission denied
2017-07-20T08:29:08.590489Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2017-07-20T08:29:08.590549Z 0 [ERROR] Aborting 2017-07-20T08:29:08.590607Z 0 [Note] Binlog end
2017-07-20T08:29:08.605607Z 0 [Note] Shutting down plugin 'ngram'
2017-07-20T08:29:08.605739Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-07-20T08:29:08.605780Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-07-20T08:29:08.619022Z 0 [Note] Shutting down plugin 'partition'
2017-07-20T08:29:08.619153Z 0 [Note] Shutting down plugin 'MyISAM'
2017-07-20T08:29:08.620655Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-07-20T08:29:08.620778Z 0 [Note] Shutting down plugin 'CSV'
2017-07-20T08:29:08.620846Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-07-20T08:29:08.620942Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-07-20T08:29:08.620998Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-07-20T08:29:08.621047Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-07-20T08:29:08.621096Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-07-20T08:29:08.621141Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-07-20T08:29:08.621186Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-07-20T08:29:08.621227Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-07-20T08:29:08.621272Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-07-20T08:29:08.621315Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-07-20T08:29:08.621355Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-07-20T08:29:08.621402Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-07-20T08:29:08.621448Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-07-20T08:29:08.621494Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-07-20T08:29:08.621542Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-07-20T08:29:08.621588Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-07-20T08:29:08.621635Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-07-20T08:29:08.621684Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-07-20T08:29:08.621730Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-07-20T08:29:08.621777Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-07-20T08:29:08.621826Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-07-20T08:29:08.621871Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-07-20T08:29:08.621916Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-07-20T08:29:08.621960Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-07-20T08:29:08.622005Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-07-20T08:29:08.622048Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-07-20T08:29:08.622084Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-07-20T08:29:08.622128Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-07-20T08:29:08.622172Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-07-20T08:29:08.622215Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-07-20T08:29:08.622259Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-07-20T08:29:08.622303Z 0 [Note] Shutting down plugin 'InnoDB'
2017-07-20T08:29:08.644637Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-07-20T08:29:08.645453Z 0 [Note] InnoDB: Starting shutdown...
2017-07-20T08:29:08.745799Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2017-07-20T08:29:08.748425Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170720 16:29:08
2017-07-20T08:29:09.428215Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2536394
2017-07-20T08:29:09.430927Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-07-20T08:29:09.431083Z 0 [Note] Shutting down plugin 'MEMORY'
2017-07-20T08:29:09.431244Z 0 [Note] Shutting down plugin 'sha256_password'
2017-07-20T08:29:09.431298Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-07-20T08:29:09.431476Z 0 [Note] Shutting down plugin 'binlog'
2017-07-20T08:29:09.431935Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
复制第一条error信息,gg发现一条信息跟我的日志文件问题一模一样,https://github.com/Microsoft/BashOnWindows/issues/2113
修改方式就是 更改mysql的端口
查看mysql的配置文件:
$ cat /etc/mysql/mysql.conf.d/mysqld.cnf
更改端口3306位8060,保存发现readonly, 没权限更改
只需要在编辑的时候,加个权限即可, sudo
至此,mysql服务可以启动
分析:因为在win里已经安装了mysql,开机时自动打开3306端口。
BashOnWindow安装mysql的更多相关文章
- Centos6.5下编译安装mysql 5.6
一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm -e ...
- 在Ubuntu 16.10安装mysql workbench报未安装软件包 libpng12-0错误
1.安装mysql workbench,提示未安装软件包 libpng12-0 下载了MySQL Workbench 6.3.8 在安装的时候报错: -1ubu1604-amd64.deb 提示: ...
- ubuntu安装mysql
好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...
- Linux1 在Linux(CentOS)上安装MySql详细记录
前记: 毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+To ...
- PHP安装mysql.so扩展
在PHP中mysql_connect模块已经逐渐被弃用,我在搭建环境时也没有再安装mysql扩展,但是今天在维护一个老项目时,出现报错 Fatal error: Uncaught Error: Cal ...
- 安装MySql for Visual Studio的坑
阅读目录 问题描述 解决过程 解决方案 总结 回到顶部 问题描述 安装MySql for Visual Studio 一般来说是为了能在VS的服务器数据连接的数据源中能选择MySql类型,如下图: 但 ...
- CentOS 7 安装MySQL 5.6遇到的疑难杂症小结
在一测试服务器(CentOS Linux release 7.2.1511)上安装MySQL 5.6(5.6.19 MySQL Community Server)时遇到下面错误,这个是因为CentOS ...
- Mac上安装MySQL记录
下载最新的MySQL社区版 官方下载地址:http://dev.mysql.com/downloads/mysql/ 为了安装更方便,建议下载dmg安装包. 最新的版本是5.7.9. 安装MySQL ...
- linux 安装mysql数据库——yum安装法
mysql数据库有多种安装方式,本文只介绍在Linux服务器上最实用.最快捷的mysql server安装方法.一.Linux服务器yum安装(CentOS6.3 64位) 所有在服务器上执行的命令, ...
随机推荐
- Nginx 针对建立TCP连接优化
L:124 sysctl -a | grep file-max //通过命令查看系统最大句柄数 [root@3 ~]# sysctl -a | grep file-max fs.file-max = ...
- Kibana-4.6.6 marvel插件license过期重新注册
1.注册新的license,https://register.elastic.co/marvel_register,注册完毕邮箱收取下载地址,将新的license下载到本地 2.到license所在目 ...
- Elasticsearch 关键字与SQL关键字对比总结
由于Elasticsearch和MongoDB/Redis/Memcache一样,是非关系型数据库.而平常使用的MySql,Oracle,SQLServer 等为关系型数据库,二者有着本质的区别,Es ...
- HDU4625 JZPTREE 【树形DP】【第二类斯特林数】
题目大意: 对1到n求题目中描述的那个式子. 题目分析: 幂不好处理,转化为斯特林数. 根据$ n^k= \sum_ { i=0 }^k S(k,i)×i!×C(n,i) $. 我们可以将问题转化为对 ...
- Python_sys.argv 命令行参数获取使用方法
import sys print(sys.argv) """ 获取命令行参数 输入 python3 sys.argv_demo.py 输出: ['argv.py'] 输入 ...
- Java 枚举(enum) 详解7种常见的用法
Java 枚举(enum) 详解7种常见的用法 来源 https://blog.csdn.net/qq_27093465/article/details/52180865 JDK1.5引入了新的类型— ...
- git 出现stderr: error: bad signature fatal: index file corrupt
命令执行依次: $ rm -f .git/index $ git reset 重启即可
- 【模板】可持久化文艺平衡树-可持久化treap
题目链接 题意 对于各个以往的历史版本实现以下操作: 在第 p 个数后插入数 x . 删除第 p 个数. 翻转区间 [l,r],例如原序列是 \(\{5,4,3,2,1\}\),翻转区间 [2,4] ...
- IDEA+Springboot+JRebel热部署实现
步骤一:在IDEA中安装JRebel插件(File->settings->plugins->search in repositories),如下图 步骤二:安装完成之后,重启idea ...
- IntelliJ IDEA快捷键总结
原文: IntelliJ IDEA快捷键 下面只列出Windows系统下的快捷键,Mac下的快捷键参考上面的链接. Remember these Shortcuts 功能 快捷键 Smart code ...