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位) 所有在服务器上执行的命令, ...
随机推荐
- hibernate主配置文件中指定session与当前线程绑定
配置一条属性 <property name="hibernate.current_session_context_class">thread</property& ...
- js判断一个元素是否在数组中
js判断一个元素是否在数组中 var arr = ['a','s','d','f']; console.info(isInArray(arr,'a'));//循环的方式 function isInAr ...
- MySQL参数调优
目录 连接相关参数 文件相关参数 缓存相关参数 MyISAM参数 InnoDB参数 连接相关参数 max_connections 允许客户端并发连接的最大数量,默认值是151,一般将该参数设置为50 ...
- Codeforces Round #443 Div. 1
A:考虑每一位的改变情况,分为强制变为1.强制变为0.不变.反转四种,得到这个之后and一发or一发xor一发就行了. #include<iostream> #include<cst ...
- Luogu5205 【模板】多项式开根(NTT+多项式求逆)
https://www.cnblogs.com/HocRiser/p/8207295.html 安利! 写NTT把i<<=1写成了i<<=2,又调了一年.发现我的日常就是数组开 ...
- DRF 分页组件
Django Rest Framework 分页组件 DRF的分页 为什么要使用分页 其实这个不说大家都知道,大家写项目的时候也是一定会用的, 我们数据库有几千万条数据,这些数据需要展示,我们不可能直 ...
- Mining Station on the Sea HDU - 2448(费用流 || 最短路 && hc)
Mining Station on the Sea Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav ...
- JVM体系结构概述
ClassLoader(类装载器) 负责加载class文件. class文件在文件开头有特定的文件标示,并且ClassLoader只负责class文件的加载,至于它是否可以运行,则由Execution ...
- CF527E Data Center Drama(构造+欧拉回路)
题目链接 大意: 给你一个无向图. 要求加最少的边,然后给这些无向图的边定向,使得每一个点的出入度都是偶数. 输出定向后的边数和边集. n<=10^5 m<=2*10^5 很巧妙的构造题- ...
- 【165223&165218】结对感想——论如何与队友完美配合
★ 为什么要结对编程? 一.结对编程的优势 搭档的形式 平等.互补 高效率.共分享 相互影响.督促学习 方便复审与反馈 二.结对编程的方式 互换的角色 相同的目的 结对编程中有两个角色: (a)驾驶员 ...