Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

beginner having a few problems..

Status
Not open for further replies.

djbeta

IS-IT--Management
Apr 16, 2004
46
US
1. I've installed MySQL 4.0.24 on Panther 10.3.8.
It appears to be setup correctly. I've installed phpmyadmin,
it also appears to be setup correctly.. except.. when I log in to
phpymyadmin, and try to log in with my admin user, it
does not take the password, rather, it accepts a blank password,
then lets me in.

The same thing happens at the command line. I can log in
to the mysql monitor in the Terminal.. when I try to log in with my
current admin user (djbeta), it prompts me for a password, and
will let me in ONLY if I enter no password. But, there is definitely a password
on this user.. somehow I deleted it for MySQL ?? I don't know how if so,
but can I put it back ?

2. The only way I can call mysqld is by first changing to the /usr/local/mysql directory, and even then, if I type mysql -u djbeta -p -h localhost, it says mysql command not found, it will work if I type bin/mysql -u djbeta -p -h localhost, then it will work.

Is there a way I can set it up so that my MySQL is password protected and also that I don't have to cd to the directory and type bin/mysql when I should only have to type mysql ?
 

sorry for the double-post.. I don't think I hit the "back" button and just hit preview.. can't forums prevent that?

I think I see now why it lets me in without a password-- a no password is setup for the root user when mysql is installed .. BUT.. i did install my current user in phpmyadmin with a password.. (same as root name)

so I have djbeta (w/no password) and djbeta (w/my typical password)

i guess that might be a problem.. perhaps I'll delete the one with the no password.

 
Amazingly enough.. after I deleted the user w/ no password in the privileges section of phpmyadmin,

it still lets me in to the mysql monitor with no password
 
A default installation of MySQL comes with 4 accounts set up, 'root' at 'localhost', 'root' at '%' (anywhere including localhost), '' (anonymous) at 'localhost', and '' at '%'. When you connect to MySQL, it validates your credentials againt the most specific account.

So, an explanation for your problem might be that you set a password for 'root' at '%' but not for 'root' at 'localhost'. It might be a good idea to delete whichever account you don't need, set up a new password if necessary, do a FLUSH PRIVILEGES to commit the changes, and try again.
 
Also, in the regards to running mysql without having to cd into directory, a unix system has a PATH for a user. A PATH is a list of directories where the shell will look for when you give a non-absolute path for command execution. You can view your PATH by typing "echo $PATH" (without quotes) at the command prompt. You will see something like /usr/bin;/usr/local/bin;/sbin for example. If you type a command that is in any of those 3 directories, it will automatically see it and execute it. However, /usr/local/mysql/bin (where mysql executable probably is) is not in the path! so the shell can't find it. If you add it to the path, however, it will. To add it, if you are using bash shell, do this "export PATH=$PATH:/usr/local/mysql/bin" (or whatever directory mysql executable is in). That's it. You will have to do it every time you log into that shell though. To not do it every time, but it into your user's .bashrc file in your home directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top