Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
How does this work?

Posted by MySQLNovice (MySQLNovice), 29 July 2003
I've installed and reinstalled MySQL as a service that starts during the system boot. (Windows 2000 Pro.) I can get the SQL monitor running fine, but from there I can't get anything to work. None of the commands in the examples I'm working with work. My system doesn't recocnized them as such. Why does this happen? Is there something that I'm missing?

Posted by admin (Graham Ellis), 29 July 2003
On 10th July, I thought you had the MySQL daemon running, and also you were able to contact it from the mysql client.

Quote:
I took a shot in the dark and entered mysql\bin\mysql.exe at the C:\> and got this:
 
Welcome to the mysql monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.0.13-nt.
 
I now have a mysql> prompt. I guess I've invoked it...


OK - are you still at that point?  Yes?   Good ... then you have the service running and can look at contacting it from other clients;  how you do so will vary depending on which client  you're using.  What are the commands in the examples you're working with?  What happens when you try to run them (can you tell us something like error messages - "don't work" isn't really enough for me to go on!).   I would hazard a guess that you've got an example of how to use some specific client software, but that client software's either not loaded, or not installed, or not configured to point to the MySQL daemon you have running.

Posted by MySQLNovice (MySQLNovice), 30 July 2003
Sorry for being so vague...I was frustrated.

Anyway, I change to the following Directory with  this command. C:\>cd C:\mysql\bin

I get this new prompt: C:\mysql\bin>

At this point I enter the following command to assign a password to the root user.

C:\mysql\bin> mysqladmin -uroot -ppassword

I'm then prompted for a password. Earlier I had used the winmysqwladmin.exe app to make MySql a sewrvice. At that time I entered a user name and password. They are listed in the my.ini Setup tab in winmysqladmin.exe.

At this point I get the following error.
mysqladmin: connect to server at  'localhost' failed
error: Access denied for user: 'root@***.*.*.* (Using Password: Yes)

Why am I getting this error when the winmsqladmin tool says that I have the correct password?


Posted by admin (Graham Ellis), 30 July 2003
I would suspect that the user name and password that you have listed in winmysqladmin (which I don't often use, and don't have to hand as I'm out of the office this week) are the ones you entered into that client to let you connect automatically every time start that client up ... and that the actual user name / password / client computer settings you have in the takes of MySQL itself are different.  Perhaps you changed the password at some stage in your testing / experimenting and didn't record the changes in the winmysqladmin setup tab?

Configuration files (my.ini, my.cnf /etc/my.cnf ~/.my.cnf depending on the opertaing system) provide MySQL clients and server with initial information on startup, and that information can include a default user name and password for clients.  The passwords that these are checked against are stored within the database itself - in the mysql database, and in there the table called user.

If you have corrupted or forgotten the password(s) for all mysql user(s) who have enough rights to get at the tables in the database called mysql, you have something of a problem; any easy tool that could let you in would be a major security hole, so there isn't such a tool.  Of course, there's a way around it at the operating system level via the computer admin's password - but
any such procedure will be rather longwinded.

Posted by MySQLNovice (MySQLNovice), 30 July 2003
So, would you recomend uninstalling and reinstalling MySQL again so that I can make a new user name and password? Should I use the winmysqladmin.exe application?

Posted by admin (Graham Ellis), 30 July 2003
If you have forgotten all of your MySQL logins that give you GRANT access at the global level, or otherwise lost the login information (e.g. corrupted the relevant tables) you could EITHER

* Re-install MySQL taking care NOT to retain the data or
* Do a fresh install on a different system, and at the operating system level transfer over the user files in the MySQL database area from the new install.

The first solution should be chosen if you don't have any data in the system yet, or if you have a good set up mysqldumps from which you can restore.  The second solution is an emergency work around if there's data that you only have in the MySQL tables that you must not loose.  With the second solution, you need to ensure that the new installation is the same release as the one for which you've forgotten the password / account information, and you need the mysql daemon to be halted before you copy the files over.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho