MySQL - Access denied for user?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
brucerowe
Level 1
Level 1
Posts: 3
Joined: Wed Dec 17, 2014 1:58 am

MySQL - Access denied for user?

Post by brucerowe » Wed Dec 17, 2014 2:15 am

I have just reformatted a new hard drive and installed the latest Linux Mint 17(Rebecca) on my 32 bit machine. The colors are gorgeous and I love the speed that it responds. However, I cannot seem to login to MySQL (MariaDB).

MySQL has been restarted with /etc/init.d/mysql restart and is running. I give the command to log in the first time:
mysql -u root -p
I press enter and I get a response:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'

I am familiar with Linux and MySQL. I have uninstalled and re-installed MySQL. I have set up many other MySQL installations on Linux (though never on Mint or Ubuntu). There was never any problem like this.

Does anyone know what is going on here? Does anyone know what do do about it?

User avatar
DataMan
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www
Contact:

Re: MySQL - Access denied for user?

Post by DataMan » Wed Dec 17, 2014 5:44 am

You referenced MariaDB in your post. I understand it's close to MySQL but not the same. Did it afford you an opportunity to establish the root account when it was built initially?

-DataMan
-who has not built a MariaDB server ... yet.
Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015

brucerowe
Level 1
Level 1
Posts: 3
Joined: Wed Dec 17, 2014 1:58 am

Re: MySQL - Access denied for user?

Post by brucerowe » Wed Dec 17, 2014 12:49 pm

MariaDB is pretty much the same as MySQL. It was built and maintained by the same team that built MySQL. When Oracle bought MySQL, a lot of people worried that Oracle would kill MySQL. MySQL competes with the commercial product. Given Oracle's adventures suing Google over the use of Java, this was not unfounded.

MariaDB is the replacement for MySQL in Red Hat and Mint. My own experience is that MariaDB also works well.

The first time I installed Maria, it installed when I re-formatted the drive and installed Mint. I did not have a chance to put in a root password. When I uninstalled and re-installed the database (with the Synaptic Package Manager), I did not have the opportunity either.

So, the database is running. I just cannot log in and start using it.
bruce@bruce-Vostro-230 ~ $ ps ax | grep mysql
1365 ? S 0:00 /bin/bash /usr/bin/mysqld_safe
1366 ? S 0:00 logger -p daemon.err -t /etc/init.d/mysql -i
1729 ? Sl 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
3174 pts/0 S+ 0:00 grep --colour=auto mysql

User avatar
DataMan
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www
Contact:

Re: MySQL - Access denied for user?

Post by DataMan » Wed Dec 17, 2014 3:30 pm

Found this:

https://mariadb.com/blog/how-reset-root ... iadb-linux

Hopefully this will get you up and running.


-DataMan
Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015

brucerowe
Level 1
Level 1
Posts: 3
Joined: Wed Dec 17, 2014 1:58 am

Re: MySQL - Access denied for user?

Post by brucerowe » Wed Dec 17, 2014 5:55 pm

IT WORKED! Those instructions were just what I needed.

Thanks again for your help.

Post Reply

Return to “Software & Applications”