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位) 所有在服务器上执行的命令, ...
随机推荐
- HTTP 错误 500.21 - Internal Server Error 处理程序“BlockViewHandler”在其模块列表中有一个错误模块“ManagedPipelineHandler
HTTP 错误 500.21 - Internal Server Error 处理程序“BlockViewHandler”在其模块列表中有一个错误模块“ManagedPipelineHandler ...
- 蒟阵P3390 【模板】矩阵快速幂
代码如下: #include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> ...
- CSS初步学习
1.选择器: 如果你要在HTML元素中设置CSS样式,你需要在元素中设置"id" 和 "class"选择器. id 选择器 id 选择器可以为标有特定 id 的 ...
- 【XSY1545】直径 虚树 DP
题目大意 给你一棵\(n\)个点的树,另外还有\(m\)棵树,第\(i\)棵树与原树的以\(r_i\)为根的子树形态相同.这\(m\)棵树之间也有连边,组成一颗大树.求这棵大树的直径长度. \(n ...
- IDEA修改module的名字
首先右键module名,选择[Refactor]-[Rename...] 然后选择[Rename module] 只修改这些对于当前开发是没有问题了 但是刚开始把module添加成maven项目的时候 ...
- 爬虫_腾讯招聘(xpath)
和昨天一样的工作量,时间只用了一半,但还是效率有点低了,因为要把两个网页结合起来,所以在列表操作上用了好多时间 import requests from lxml import etree heade ...
- linux中$#,$0,$1,$2,$@,$*,$$,$?的含义
$# 是传给脚本的参数个数$0 是脚本本身的文件名$1 是脚本后接的第一个参数$2 是脚本后接的第二个参数$@ 是传给脚本的所有参数列表,"$1" "$2" & ...
- 【bfs】迷宫问题
[题目描述] 定义一个二维数组: int maze[5][5] = { 0,1,0,0,0, 0,1,0,1,0, 0,0,0,0,0, 0,1,1,1,0, 0,0,0,1,0, }; 它表示一个迷 ...
- [FJOI2016]神秘数(脑洞+可持久化)
题目描述 一个可重复数字集合S的神秘数定义为最小的不能被S的子集的和表示的正整数.例如S={1,1,1,4,13}, 1 = 1 2 = 1+1 3 = 1+1+1 4 = 4 5 = 4+1 6 = ...
- pandas to_html
如何将表格数据以图片的形式展现,主要目的则是为了防止爬虫. 为了解决这个问题,刚开始选择的是matplotlib.pyplot.table,但由于随着数据的字段长短不一,且matplotlib实际落地 ...