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位) 所有在服务器上执行的命令, ...
随机推荐
- luogu3702-[SDOI2017]序列计数
Description Alice想要得到一个长度为nn的序列,序列中的数都是不超过mm的正整数,而且这nn个数的和是pp的倍数. Alice还希望,这nn个数中,至少有一个数是质数. Alice想知 ...
- Xml文件汉化准备
如何提取xml文件中的字符串,是汉化的前提. Passolo中的解析器不能正确解析文件,此时可以采用Text Parser进行解析. 通过自定义规则,可以相对完整的把字符串提取出来. 一张图片就能说明 ...
- Go语言变量和常量
一.变量相关 1.变量声明 C# : int a; Go : var a int; 需要在前面加一个var关键字,后面定义类型 可以使用 var( a int; b string;)减少var 2.变 ...
- mysql-tar包搭建过程
第一: wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz tar z ...
- ceph 重启,停止,开始
systemctl restart ceph-mon@mon-node3 systemctl stop ceph-mon@mon-node3 systemctl start ceph-mon@mon- ...
- HUST 1555 数学作业
参考自:https://www.cnblogs.com/ECJTUACM-873284962/p/6394892.html 1555 - A Math Homework 时间限制:1秒 内存限制:12 ...
- HDU3966-Aragorn's Story-树链剖分-点权
很模板的树链剖分题 注意什么时候用线段树上的标号,什么时候用点的标号. #pragma comment(linker, "/STACK:102400000,102400000") ...
- 面向对象—的__new__()方法详解
[Python] Python 之 __new__() 方法与实例化 __new__() 是在新式类中新出现的方法,它作用在构造方法建造实例之前,可以这么理解,在 Python 中存在于类里面的构 ...
- python中可变参数和关键字参数总结
#_*_coding='utf-8' #可变参数 def person(name,age,*args): #定义了可变参数args print('传入的名字为:',name) print('传入的年龄 ...
- Linux mount BSD disk partition
Linux mount BSD disk partition 来源 https://www.cnblogs.com/jhcelue/p/6858159.html 假设须要从第二块硬盘复制文件.该硬盘格 ...