?
Solved

mysql doesnt ask for username and password

Posted on 2014-01-24
6
Medium Priority
?
359 Views
Last Modified: 2014-02-01
Hello

I have just gained access to a server with a hosting company which has mysql preinstalled. I've only used a server where I have installed mysql myself. On this server i can type mysql at the command line and it will open without needing a username or password. Looking at the mysql. users table there are several users including 2 root users (with different hosts, one is localhost and one is something else). I dont know the root passwords as I didn't create them.

Is it running in safe mode without password protection? If so, how do i tell?

Do i need to change the root password as described here?

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch34_:_Basic_MySQL_Configuration#.UuKwyNLFJCI

i.e change the root password and then restart the service in normal mode?

Sorry for asking, I'm just a bit nervous about doing it

thanks in advance
0
Comment
Question by:andieje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39807312
I've never heard of that exactly but I have worked with a couple of hosting companies that will automatically log you into your own phpMyAdmin when you are already logged into your account.
0
 
LVL 24

Accepted Solution

by:
johanntagle earned 2000 total points
ID: 39807758
Check  also if you have a .my.cnf file in your home directory.  I once encountered a server that had the username and password stored there.  The mysql client looks for that file if you didn't enter complete credentials.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39807768
If this is a completely new installation of MySQL, it might still have anonymous users with no user name or password.  Those should be deleted if they are still there.
http://dev.mysql.com/doc/refman/5.1/en/default-privileges.html
0
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

Author Comment

by:andieje
ID: 39808649
the my.cnf file just has the max number of connections set to 500  and log_slow_queries. There is nothing else in the file. As mentioned in the question there are several users in mysql.users table. There are 2 root users - one at localhost and one at something which appears to be the hosting company. There are 10 users in total, all of which appear to have encrypted passwords. I presume this means the anonymous user has gone?

I am not logging in via phpmyadmin. I am ssh into the server and then when i type mysql at the command line it just opens and you can access the databases therein. There are 9 databases including the mysql one, I dont know what these are but I havent made them.

I've never seen this before
0
 

Author Comment

by:andieje
ID: 39808654
Is this because i am logged into ssh as root? i've always been root before and had to give mysql a username and password. If i type mysql -u root -p mysql it will ask me for a password but if i just type mysql it starts the database anyway
0
 

Author Closing Comment

by:andieje
ID: 39826857
that was it
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question