Stop MYSQL service:
sudo service mysql stopChange home directory of mysql from nonexistent to original directory where it is supposed to be
sudo usermod -d /var/lib/mysql/ mysqlStart MYSQL service
sudo service mysql start| # Install MySQL | |
| mysql_config_file="/etc/mysql/my.cnf" | |
| echo "mysql-server mysql-server/root_password password secret" | sudo debconf-set-selections | |
| echo "mysql-server mysql-server/root_password_again password secret" | sudo debconf-set-selections | |
| apt-get -y install mysql-client mysql-server | |
| sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" ${mysql_config_file} | |
| usermod -d /var/lib/mysql/ mysql | |
| service mysql start | |
| # Allow root access from any host | |
| echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION" | mysql -u root --password=secret | |
| echo "GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION" | mysql -u root --password=secret | |
| service mysql restart |
Stop MYSQL service:
sudo service mysql stopChange home directory of mysql from nonexistent to original directory where it is supposed to be
sudo usermod -d /var/lib/mysql/ mysqlStart MYSQL service
sudo service mysql startWindows Version 10.0.18363 Build 18363 WSL
Ubuntu 18.04
MySQL Server version: 5.7.29-0ubuntu0.18.04.1 (Ubuntu)All I had to run was this:
sudo usermod -d /var/lib/mysql/ mysqlAllowed me to start the service - thanks much!
I am happy because my work has have useful for you
Windows Version 10.0.18363 Build 18363 WSL
Ubuntu 18.04
MySQL Server version: 5.7.29-0ubuntu0.18.04.1 (Ubuntu)
All I had to run was this:
sudo usermod -d /var/lib/mysql/ mysqlAllowed me to start the service - thanks much!