Cannot start Mysql-server Service - mysql

I have an issue, I can not start mysql service and how to configure mysql-server. I forgot password and username for mysql-server.
Excuse me for my weak English.
screenshot-issue

If your case is just forgot password see then doc here .
Or remove mysql then reinstall may solve your problem.
Remove mysql:
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
Reinstall:
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
And just check your disk isn't full.

Related

Why is mysql asking for password after default installation as root

I see this when I ssh to my Ubuntu server:
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-1018-aws x86_64)
After installing mysql, I try to login to the mysql server but for some reason it asks me for a password that I do not have. So, I ran the following commands to uninstall mysql and reinstall.
Uninstall
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
The I used this link as guide to install mysql, and the commands went as follows:
sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service
When I run:
sudo mysql_secure_installation
The prompt asks me to “Enter password for the user root”. Where do I find this password?
The idea of the command is to set the password.
How can I install mysql in this server to then be able to manage my databases?

Even after uninstalling mysql, i still have it in my UBUNTU 20.04

I had many issues with MySQL software, even after uninstalling the files ten times, I still have it in my machine.
I want to remove everything because I have issues when I re-installing it.
The picture below is a screenshot after uninstalling all the MySQL packages.
I tried these commands :
sudo apt remove --purge mysql-server
sudo apt purge mysql-server
sudo apt autoremove
sudo apt autoclean
sudo apt remove dbconfig-mysql
These steps helped me.
sudo apt autoremove --purge mysql\* mariadb\*
sudo apt clean
sudo mv /var/lib/mysql /var/lib/mysql_bak
sudo mv /etc/mysql /etc/mysql_bak
Done.

MySQL- Mysql-server uninstall ubuntu

I want to remove mysql with all data and reinstall it back. After uninstall and new installation all users are the same. Can i remove it and wipe all users, to have only one new root user?
sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
sudo apt-get autoremove -y
sudo apt-get autoclean
sudo rm -rf /etc/mysql
sudo rm -rf /etc/mysql /var/lib/mysql
apt-get --purge remove "mysql*"
This helped me.

Ubuntu Mysql Uninstall / Reinstall

I have a Mysql installation I'd like to remove and reinstall, running Ubuntu 14.04 on a LAMP stack. The passwords are all messed up, phpmyadmin isn't installing correctly... I just want a restart.
the command..
sudo apt-get --purge remove mysql-server mysql-common mysql-client
is returning the following error...
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
I'm having a real hard time trying to figure out what to do with this.
this command...
sudo dpkg-reconfigure mysql-server-14.14
tells me...
package 'mysql-server-14.14' is not installed and no information is available
While..
mysql --version
tells me...
mysql Ver 14.14 Distrib 5.5.40, for debian-linux-gnu (x86_64) using readline 6.3
Any ideas how i can wipe this clean and restart?
thank you.
First, remove already installed mysql-server using-- sudo apt-get remove --purge mysql-server mysql-client mysql-common
Then clean all files sudo apt-get autoremove
Then install mysql-server -- sudo apt-get install -f mysql-server
Start mysql server-- sudo systemctl start mysql
Check status of mysql-server-- systemctl status mysql
Maybe strip the --?
sudo apt-get purge mysql-server mysql-common mysql-client
sudo apt-get install mysql-client mysql-server mysql-common
try to do this:
sudo apt-get install aptitude
sudo aptitude purge mysql-server mysql-common mysql-client
sudo aptitude install mysql-client mysql-server mysql-common

Error while installing MYSQL

I was trying to install mysql in ubuntu. I applied following command for it
sudo apt-get install mysql-server-5.5
But got the following error.
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.41-0ubuntu0.14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please help me to solve the error.
Doing this solved it for me:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.5 mysql-server-core-5.5
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server
seems like there's an error with one of the packages being installed or that quite never installed properly in the past.
http://ubuntuforums.org/showthread.php?t=1642173
here is a link that helps identify the package and how to correct it.
Try given commands.
sudo apt-get purge mysql-client-core-5.6
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-client-core-5.5
sudo apt-get install mysql-server
Try this link
I had this problem And with this method, the problem was solved
1-Get the list of MySQL packages installed on the system by executing the command
sudo dpkg -l | grep mysql
2-Remove the the packages shown above by executing the command
sudo apt-get --purge autoremove <packages from the step 1>
3-Delete /var/lib/mysql
4-To add MariaDB repository to Ubuntu, run the commands below to install the repository key to your system.
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
5-
sudo sh -c "echo 'deb [arch=amd64,i386] https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu '$(lsb_release -cs)' main' > /etc/apt/sources.list.d/MariaDB-10.2.list"
6-After that, run the commands below to install the latest version of MariaDB.
sudo apt-get update
sudo apt-get install mariadb-server mariadb-client
7-
cd /var/run
sudo cp mysqld/ mysqld.bc -rf
sudo chown mysql:mysql mysqld.bc/
sudo service mysql stop
sudo cp mysqld.bc/ mysqld -rf
sudo chown mysql:mysql mysqld -R
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
8-Now able to log in database using
mysql -u root
9-Then to update root password:
UPDATE user SET authentication_string=password('YOURPASSWORDHERE') WHERE user='root';
FLUSH PRIVILEGES;