Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start mysql service in wsl. #2113

Closed
Ilcyb opened this issue May 16, 2017 · 9 comments
Closed

Can't start mysql service in wsl. #2113

Ilcyb opened this issue May 16, 2017 · 9 comments

Comments

@Ilcyb
Copy link

Ilcyb commented May 16, 2017

  • Your Windows build number: 10.0.15063

  • What you're doing and what's happening:
    When I want start mysql service,some problem happend.

sudo service mysql start
Starting MySQL database server mysqld
No directory, logging in with HOME=/
[fail]

then,I type
sudo usermod -d /var/lib/mysql/ mysql
and start mysql service again,
sudo service mysql start
this time,no log " No directory, logging in with HOME=/",but still failed.

This is /var/log/mysql/error.log

2017-05-16T12:06:00.377497Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-05-16T12:06:00.620422Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-05-16T12:06:00.701991Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-05-16T12:06:00.702485Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-05-16T12:06:00.895963Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-05-16T12:06:00.902923Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 21617 ...
2017-05-16T12:06:00.920469Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-05-16T12:06:00.920668Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-05-16T12:06:00.920782Z 0 [Note] InnoDB: Uses event mutexes
2017-05-16T12:06:00.920896Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-05-16T12:06:00.921005Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-05-16T12:06:00.921111Z 0 [Note] InnoDB: Using Linux native AIO
2017-05-16T12:06:00.921625Z 0 [Note] InnoDB: Number of pools: 1
2017-05-16T12:06:00.921981Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-05-16T12:06:00.925641Z 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-05-16T12:06:00.925793Z 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2017-05-16T12:06:00.925909Z 0 [Warning] InnoDB: Linux Native AIO disabled.
2017-05-16T12:06:00.927750Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-05-16T12:06:00.940119Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-05-16T12:06:00.979869Z 0 [Note] InnoDB: page_cleaner coordinator priority: -20
2017-05-16T12:06:00.989520Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-05-16T12:06:01.070011Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-05-16T12:06:01.071257Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-05-16T12:06:01.300226Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-05-16T12:06:01.303967Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-05-16T12:06:01.304375Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-05-16T12:06:01.322921Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2539588
2017-05-16T12:06:01.329788Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-05-16T12:06:01.336796Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-05-16T12:06:01.344434Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170516 20:06:01
2017-05-16T12:06:01.348572Z 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-05-16T12:06:01.348714Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2017-05-16T12:06:01.348847Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2017-05-16T12:06:01.349013Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2017-05-16T12:06:01.349170Z 0 [ERROR] Can't start server: Bind on TCP/IP port: Permission denied
2017-05-16T12:06:01.349271Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2017-05-16T12:06:01.349481Z 0 [ERROR] Aborting

2017-05-16T12:06:01.349607Z 0 [Note] Binlog end
2017-05-16T12:06:01.349752Z 0 [Note] Shutting down plugin 'ngram'
2017-05-16T12:06:01.349865Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-05-16T12:06:01.349959Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-05-16T12:06:01.350051Z 0 [Note] Shutting down plugin 'partition'
2017-05-16T12:06:01.350141Z 0 [Note] Shutting down plugin 'MyISAM'
2017-05-16T12:06:01.350233Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-05-16T12:06:01.350325Z 0 [Note] Shutting down plugin 'CSV'
2017-05-16T12:06:01.350414Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-05-16T12:06:01.350537Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-05-16T12:06:01.350627Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-05-16T12:06:01.350716Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-05-16T12:06:01.350804Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-05-16T12:06:01.350891Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-05-16T12:06:01.350979Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-05-16T12:06:01.351108Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-05-16T12:06:01.351201Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-05-16T12:06:01.351289Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-05-16T12:06:01.351376Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-05-16T12:06:01.351464Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-05-16T12:06:01.351551Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-05-16T12:06:01.351638Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-05-16T12:06:01.351726Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-05-16T12:06:01.351813Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-05-16T12:06:01.351899Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-05-16T12:06:01.351986Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-05-16T12:06:01.352072Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-05-16T12:06:01.352159Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-05-16T12:06:01.352246Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-05-16T12:06:01.352332Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-05-16T12:06:01.352420Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-05-16T12:06:01.352507Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-05-16T12:06:01.352593Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-05-16T12:06:01.352680Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-05-16T12:06:01.352766Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-05-16T12:06:01.352853Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-05-16T12:06:01.352940Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-05-16T12:06:01.353069Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-05-16T12:06:01.353215Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-05-16T12:06:01.353312Z 0 [Note] Shutting down plugin 'InnoDB'
2017-05-16T12:06:01.353476Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-05-16T12:06:01.353674Z 0 [Note] InnoDB: Starting shutdown...
2017-05-16T12:06:01.454252Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2017-05-16T12:06:01.459446Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170516 20:06:01
2017-05-16T12:06:02.834536Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2539607
2017-05-16T12:06:02.838520Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-05-16T12:06:02.838896Z 0 [Note] Shutting down plugin 'MEMORY'
2017-05-16T12:06:02.839197Z 0 [Note] Shutting down plugin 'sha256_password'
2017-05-16T12:06:02.839478Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-05-16T12:06:02.839968Z 0 [Note] Shutting down plugin 'binlog'
2017-05-16T12:06:02.840873Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2017-05-16T12:06:02.894596Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

@sunjoong
Copy link

@Huangyunbo1996 - I think it might be also a network problem because there is a ERROR line in your log; "[ERROR] Can't start server: Bind on TCP/IP port: Permission denied".

@Ilcyb
Copy link
Author

Ilcyb commented May 16, 2017

@sunjoong But my network is normal.
I even reinstall bash on windows,but the problem still exists.

@sunjoong
Copy link

@Huangyunbo1996 - I know. I don't know that might be a similar issue like mine but I get a problem of tcp port not listen; In my case, anti-virus might make it but that might be happen without anti-virus, I heard. #1853 (comment) is a comment for port 8000, mysql uses port 3306, and that comment is not a solution or workaround but a way to collect log. But... if the problem be more clear, there would be a chance to get a solution, I think.

@Ilcyb
Copy link
Author

Ilcyb commented May 16, 2017

@sunjoong You're right. When I change the mysql port from 3306 to 8060, mysql service can work properly, and I can connect to mysql correctly.
Thank you very much.

@misterjaytee
Copy link

For other people who may stumble across this, here's my scenario.

WSL with MySQL installed, had two problems:

  1. Home directory warning
  2. Service would fail to start

The first issue is easy to sort - change the directory for the mysql user:
sudo usermod -d /var/lib/mysql/ mysql

For the second issue, if you're like me and you have a development environment setup under Windows, you may have MySql installed and running under Windows. Because the networking is shared between Windows and WSL, the two instances of MySql cannot both have the default port settings (3306). In my case, I changed the Windows running version of MySql to use port 3308, and then I could run the WSL version no problem:
sudo service mysql start

@kayakyakr
Copy link

Can't recommend enough to run services like mysql via docker for windows

@digitlimit
Copy link

Changing to 3306 to 8060 works

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
#     
# * Basic Settings
#
user            = mysql
# pid-file      = /var/run/mysqld/mysqld.pid
# socket        = /var/run/mysqld/mysqld.sock
port            = 8060
# datadir       = /var/lib/mysql

@alanbueno
Copy link

if anyone's ended up here struggling with wix-embedded-mysql and for some reason can't change the mysql settings in your WSL distro or host unix system, you can just disable it through the custom mysqld setting .withServerVariable like:

.withServerVariable("innodb_use_native_aio", 0)

That option's only doable if you really don't care about InnoDB usage in your code though.

@johncy65
Copy link

In my case some docker containers were taking up that port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants