Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
user@mothership ~ $ service mysql stop
user@mothership ~ $ mysqld_safe --skip-grant-tables &
[1] 6576
user@mothership ~ $ 161127 17:16:39 mysqld_safe Logging to syslog.
161127 17:16:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
161127 17:16:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done mysqld_safe --skip-grant-tables
user@mothership ~ $ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
The blank line you see between mysql.pd ended and the [1]+ Done, that was just a blinking cursor until I hit enter. Any ideas? Thanks.
I don't know what this means but I just navigated to /var/run/mysqld/ and there is not mysqld.sock file there, or any other file apart from . & .. But I'm sure I don't know what I'm talking about.
OK, lets back up a step and ask all the right questions...
What distro and version is this?
Is this on a remote VPS or a local system?
What version of MariaDB or MySQL?
Does this mysql server start normally? Do service mysql start/stop report success?
I just re-installed Linux Mint 18 (Cinnamon) over Mint 17 and I'm trying to get all my file and packages working again. This is running on localhost and I couldn't really tell you how it's been running since I've just got it installed on Mint 18. I also can't be sure of the version but I think it's MariaDB 10.
I just re-installed Linux Mint 18 (Cinnamon) over Mint 17 and I'm trying to get all my file and packages working again. This is running on localhost and I couldn't really tell you how it's been running since I've just got it installed on Mint 18. I also can't be sure of the version but I think it's MariaDB 10.
So, if it was a reinstall then it is most likely that MySQL ws never initialized on this machine. If so, this isn't a password change problem but a database initialization problem.
If you are sure that you had data in the MySQL database on the old Mint and did not reformat the drive for the new Mint, we will need to find that first and back it up - so decide this first.
If you had no old data to save or reformatted the drive we really just need to initialize the database and get it started.
To do that you will need to run mysql_install_db, then get it started with mysqld_safe.
I am not a Mint user, so you may want to check their docs specific to your version.
We already know it is installed because mysqld_safe is trying to start, so we just need to initialize it and start the server.
The basic steps common to most distros are, as root...
Code:
/usr/bin/mysql_install_db --user=mysql
... then start the server with...
/usr/bin/mysqld_safe
...once it is running, run...
/usr/bin/mysql_secure_installation
When you run mysql_secure_installation you will get the chance to set the root password.
Last edited by astrogeek; 11-28-2016 at 08:38 PM.
Reason: typos
Okay I'll give that a try. In the past I have just installed MariaDB on my new machine and sourced what few db projects I had exported before I wiped out my machine. Mostly just a few small databases from courses I'm following on udemy.com
I just re-installed Linux Mint 18 (Cinnamon) over Mint 17 and I'm trying to get all my file and packages working again. This is running on localhost and I couldn't really tell you how it's been running since I've just got it installed on Mint 18. I also can't be sure of the version but I think it's MariaDB 10.
That would have been a pretty important thing to mention in your initial problem description, by the way. Please review the Site FAQ for guidance on asking complete questions as that will help us help you as efficiently as possible.
You can check version whether it is running or not:
Code:
mysql --version
You have not yet told us...
* What the log says when you try to start with mysqld_safe as mentioned above
* Whether it starts normally or not which would confirm whether it has ever been started on this installation
So we still don't know whether it has ever been initialized or not, even though I suspect it has not.
Quote:
Originally Posted by Garrett85
Okay I'll give that a try. In the past I have just installed MariaDB on my new machine and sourced what few db projects I had exported before I wiped out my machine. Mostly just a few small databases from courses I'm following on udemy.com
This says that you did export all your valuable data and wiped the machine before reinstalling.
In other words, you do have backups of your data...? How did you export those, mysqldump?
And the initialization method I posted above is a general case for MySQL with several possible options - it is not copy/paste code. Please see your distro's documentation for your case.
Quote:
Originally Posted by Garrett85
But of course I can't source my exported files if I can't even login.
And you can't login unless the server is running, and the server cannot run until it has been initialized...
user@mothership ~ $ mysql --version
mysql Ver 15.1 Distrib 10.0.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Thanks, that helps and confirms it is installed.
Quote:
Originally Posted by Garrett85
user@mothership ~ $ sudo mysqld_safe
[sudo] password for user:
161130 19:04:30 mysqld_safe Logging to syslog.
161130 19:04:30 mysqld_safe A mysqld process already exists
user@mothership ~ $
That would definitely indicate that it is running, or has been started and killed leaving the pid file behind.
So, let's verify that one way or the other. What does this say (as root, or sudo if necessary)?
Code:
ps aux |grep mysqld
That will tell us if the process is running, and what parameters were used to start it.
Then as asked previously, does it start and stop normally? That is, do these produce any error/success messages?
Code:
service mysqld start
service mysqld stop
Form there we can plot the path to the desired end.
Quote:
Originally Posted by Garrett85
No I don't think it's ever been started since my new installation of Mint 18 over Mint 17. I used phpmyadmin to export my databases.
OK, as I recall PHPMyAdmin uses mysqldump. I was mostly looking for some confidence that your data were safe and usable.
Also, please place your code snippets inside [CODE]...[/CODE] tags for better readability. You may type those yourself or click the "#" button in the edit controls.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.