|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I established a user 'root' and a p.w. for MySQL real early during installation (possibly a confussion of mine).
Using that p.w., I can log into MySQL and work with the "mysql>" prompt. But when I invoke, as LINUX root-user, at a terminal's LINUX prompt: "mysqladmin version", the response is: "Access denied for user: 'root@localhost' (Using password: NO)' The password I gave to "root" of MySQL is different from the LINUX root password. I understand that 'root' of LINUX and passwords are completely different things from users and passwords of MySQL. How do we communicate with MySQL, from the LINUX prompt, (who we are) and (our MySQL password), so as to access the "mysqladmin" program?? Thanks for helping. |
|
#2
|
|||
|
|||
|
You have to specify the password whenever you connect.
mysqladmin version -u root -ppassword |
|
#3
|
|||
|
|||
|
Thankyou, rod k, your answer was good.
|
|
#4
|
|||
|
|||
|
In the above circumstances, I have to provide user and p.w. data for every access from the Linux prompt, and that works fine.
However, is there a way to "connect" and "remain connected" to the database from the Linux prompt? Also, in a brief way, how would an application running under Linux remain connected, so it queries, modifies, etc., without passwording on each access? Thanks for answering. |
|
#5
|
|||
|
|||
|
To connect to mysql normally, you would use 'mysql', not 'mysqladmin'.
mysql -u root -p or mysql -u root -h [hostname] -p would prompt for the root password, and then you will have a mysql> prompt, which you can keep open as long as you like, and close when done with 'quit'. For an application running under Linux to connect to MySQL depends on what exactly you mean by that. Are you developing this application? Then you need to learn the MySLQ API. If you mean a previously developed client application, that depends on how that application was created. Basically, however, if your software tool can hold the username and password as a configuration, then you could start it up without specifying username and password every time. In PHP, I use one include file to specify username, hostname, and password, and all other places I access the database, I just refer to that file. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > COMMANDS TO MYSQL FROM LINUX O.S. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|