LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-18-2017, 11:25 AM   #1
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,581

Rep: Reputation: 144Reputation: 144
mysql/mariadb install root password not working


Hi,
I have installed a couple of mysql servers in the recent years on various systems. This now is happening on current mint cinnamon (debian version stretch/sid)

1. sudo apt install mariadb-server mariadb-client
2. sudo /etc/init.d/mysql start

as I could not login as root without password I ran

3. sudo /usr/bin/mysql_secure_installation

and setup a root password in this process, see the last lines of this:
"Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure."

Unfortunately I cannot login to the running server as root with the password i set with mysql_secure_installation

I could not login without password at any time. Right after starting the new server either. I found a couple howtos on the web basically saying the following;

Step # 1: Stop the MySQL server process.

Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for a password.

Step # 3: Connect to the MySQL server as the root user.

Step # 4: Set a new root password with an update SQL and flush privileges.

Step # 5: Exit and restart the MySQL server.


This does not work either. I still cannot login. Am I missing something? Any help is highly appreciated!
j
 
Old 03-18-2017, 12:14 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,012
Blog Entries: 5

Rep: Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856
If you're running the latest Mint, version 18.1, you are using systemd. I would have expected to see at least a systemctl start mariadb somewhere in your list of commands.
 
Old 03-18-2017, 03:53 PM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,581

Original Poster
Rep: Reputation: 144Reputation: 144
sudo /etc/init.d/mysql start

That did start the server and uses systemctl. The server was running and reachable.The only problem was the password.

I have then downloaded the package from mariadb.org, run the setup scripts, set a root password during this process - but the same result.

What actually did the trick was the guide on this page:
http://askubuntu.com/questions/70545...24-unix-socket

sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
update user set plugin="mysql_native_password";
quit;
/etc/init.d/mysql stop
sudo kill -9 $(pgrep mysql)
/etc/init.d/mysql star

Setting the plugin to "mysql_native_password" is the crucial thing

Now I can finally login as root.

Thanks for your time, cheers j

Last edited by j-ray; 03-18-2017 at 03:56 PM.
 
1 members found this post helpful.
Old 03-18-2017, 04:17 PM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,012
Blog Entries: 5

Rep: Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856Reputation: 2856
Ok, sorry I was off-track, but glad you got it worked out!
 
Old 09-19-2018, 02:54 PM   #5
McSebi
LQ Newbie
 
Registered: Sep 2018
Posts: 1

Rep: Reputation: Disabled
THANK YOU for this post! I was searching for days before I found this. I hope this post ranks a bit better on google in the future.
 
  


Reply

Tags
installation, mariadb, mysql, password, root


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to install Linux, Lighttpd, MariaDB (MySQL), PHP (LLMP) on CentOS 7 LXer Syndicated Linux News 0 06-12-2015 11:50 AM
LXer: How to install LAMP stack (Apache, MariaDB/MySQL and PHP) on CentOS LXer Syndicated Linux News 0 11-04-2014 09:32 AM
LXer: How to reset a root password in MariaDB on Linux LXer Syndicated Linux News 0 06-18-2014 02:51 AM
I need help to mariadb/mysql going on 13.1 milestone 4 new install. Glenn D. Linux - Software 1 08-22-2013 01:24 AM
Unable to set root password on new mysql install Arty Ziff Linux - Server 2 01-22-2009 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration