Solved

mysql doesnt ask for username and password

Posted on 2014-01-24
6
357 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 500 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

719 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