(I have MySQL server on Windows 10, but on port 3307. Idk if this matters but just in case!)
I couldn't sudo service mysql start
nor sudo /etc/init.d/mysql start
and it returned
No directory, logging in with HOME=/
mkdir: cannot create directory ‘//.cache’: Permission denied
-su: 19: /etc/profile.d/wsl-integration.sh: cannot create //.cache/wslu/integration: Directory nonexistent [Failed]
I googled about reinstalling mysql in Ubuntu and followed the following procedure.
- https://github.com/microsoft/WSL/issues/1761
sudo su
apt-get remove --purge 'mysql*'
apt-get autoremove
apt-get autoclean
rm -f /etc/mysql /var/lib/mysql
apt-get install mysql-server
But while trying apt-get install mysql-server
I got the error below.
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not permitted
Cannot stat file /proc/1/fd/10: Operation not permitted
Cannot stat file /proc/1/fd/6: Operation not permitted
Cannot stat file /proc/5/fd/7: Operation not permitted
Cannot stat file /proc/5/fd/10: Operation not permitted
Cannot stat file /proc/5/fd/5: Operation not permitted
Cannot stat file /proc/843/fd/7: Operation not permitted
Cannot stat file /proc/843/fd/10: Operation not permitted
Cannot stat file /proc/843/fd/5: Operation not permitted
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
I've been googling Cannot open /proc/net/unix: No such file or directory
and invoke-rc.d: could not determine current runlevel
problems but could not find the right solution for this issue.
I really appreciate if you could give me some advice on this. Thanks!
When I looked into the log file /var/log/mysql/error.log
I found
[ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
I disabled the use of Native AIO by creating a new config file /etc/mysql/conf.d/no_native_aio.conf
:
[mysqld]
innodb_use_native_aio = 0
Then I was able to start the databse server like so:
sudo service mysql start
I also had to run
sudo mysql_secure_installation
to set the password for the root user.
and I had to trick dpkg
into believing that postinstall script had run
successfully by:
exit 0
as the second line in /var/lib/dpkg/info/mysql-server-8.0.postinst
sudo dpkg --configure -a
exit 0
from /var/lib/dpkg/info/mysql-server-8.0.postinst
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With