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.
I hate MySQL issues, none of the HOWTOs ever get close to solving your problems. So on the New Server (old server but upgraded to 18.04 LTS) I get MySQL install, but nothing works because there are 20 users that have to be create.
I have the users and their "CREATE" statements in a .sql file and normally you run the cmd:
Code:
mysql -u root -p < myuserfile.sql
And it's done!
But no nothing but errrors and working on this for over 24 hrs, find this HOWTO at:
I'm also kinda lazy, so I use phpMyAdmin a lot to figure out sql syntax if I'm having a problem, 'tho of course I have to write actual sql when using it in a program.
It would be helpful to know what version of mysql you're running...
How you installed it.
What errors you're getting.
It's been awhile since I set up a new server, but my recollection is that the mysql root account on a new installation doesn't have a password.
I'm also kinda lazy, so I use phpMyAdmin a lot to figure out sql syntax if I'm having a problem, 'tho of course I have to write actual sql when using it in a program.
It would be helpful to know what version of mysql you're running...
How you installed it.
What errors you're getting.
It's been awhile since I set up a new server, but my recollection is that the mysql root account on a new installation doesn't have a password.
scasey,
Hey Buddy! Posted the errors! Started out that I just could not login to PHPmyAdmin, but then when I followed that HOWTO totally screwed it all up!
Just to make it EZ gonna purge and re-install MySQL. Remember from before having to manually edit/update the mysql.ini and a conf file for PHP, but forgot that. The PHPmyAdmin config file config.inc.php always has to be updated as session timeouts and other parms are always missing in the default file and then the MySQL user and pwd also have to be set there.
After several years of MySQL then MariaDB working without issue, I upgraded to Linux Mint 19.3 the installation of MariaDB failed miserably. I just upgraded to Mint 20, and the reinstall of MariaDB went flawless.
Before going further.
1. Kubuntu 20.04 was released in April. So why not upgrade directly to that version?
2. You mention having 20 users. For starters, just get one user working.
3. When you do an internet help search on installing MySQL you will be getting a lot of old posts/tutorials that are out of date. Look at the posting date and also the distribution that post/tutorial applies to.
4. The login authentication method for both MariaDB/Mysql have been changed. You need to be aware of using "auth_socket" and "mysql_native_password"
As a quick overview follow all the steps to install the database except for doing "mysql_secure_installation". Additionally do not create a root password at this time.
With your first login to MySQL create a new user and grant that user all permissions. Go ahead and install PHPMyAdmin. However, when logging into PHPMyAdmin, login as the new user you just created in MySQL. While in PHPMyAdmin go to the root account and assign root a password.
On my current MariaDB, I have use sudo when signing in with Admin rights.
myuser@myserver:~$ sudo mysql -u root
[sudo] password for myuser:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 72
Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
I then created a general password to do my work and only use root to define databases and tables.
MariaDB [(none)]>
No password is required except Linux OS Password, maybe your system requires a similar means of access.
Recent installations of mariadb (at least from version 10.3 on, perhaps 10.1 on) login is via unix-socket, not password. This means the login will be by the current user and no password will be required since a password was required to log in to the system as that user. The mariadb folks apparently feel that is more secure. It is possible to go back to password login but that is not the issue here. To log in as the current user simply
Code:
mysql
To log in as another user, including root
Code:
sudo <username> mysql
This assumes sudo permission of course, else su to the user and login.
OK! Ran: apt purge mysql, then new install but still locked out. Pretty sure there are files needing to delete after the purge that are still having be locked out of it.
On my current MariaDB, I have use sudo when signing in with Admin rights.
myuser@myserver:~$ sudo mysql -u root
[sudo] password for myuser:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 72
Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
I then created a general password to do my work and only use root to define databases and tables.
MariaDB [(none)]>
No password is required except Linux OS Password, maybe your system requires a similar means of access.
dmchess,
The issue is that any attempt to login to mysql always says:
Quote:
mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
or
Quote:
mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
And both used to work before I followed that HOWTO to fix the fact the "ROOT" had no permissions to change anything!
@TBotNik: Go back to my earlier post. If you have PHPMyAdmin running and can login as another user that has full grant database privileges, see if you can assign a root password under PHPMyAdmin.
Do you have a "second" user with full grant privileges to MySQL?
I finally have MySQL working! I wrote a BASH script to completely purge it, then re-installed it, then used some .sql files to create all needed users with permissions and finally added the missing DB and table create .sql files from the backups.
Still having issues with Apache and PHPmyAdmin, so still not in full control, but already have a thread open on this board for the Apache issues.
Cannot see MySQL in phpmyadmin, but working perfectly in MySQLworkbench!
If I may suggest this time make regular backups of your setup. Linking my script from git so you can use it as a template if you wish. This makes new installs or whatever a breeze. Simple import.
Sql function of course. It's built for my Docker usage but the general idea should be the same. Requires a dedicated user with privileges enough to dump the whole of all dbs.
jmgobson1981, thank you for sharing your script, but please keep in mind that this user you have chosen to help has several web pages with false or nonsensical IT "qualifications" to lure in trusting customers, and also tells lies here on LQ.
I wrote about this before but can't find it right now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.