Current location: Hot Scripts Forums » Programming Languages » PHP » How to change Mysql username

How to change Mysql username

Reply
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: Nov 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question How to change Mysql username

Hi all, this is my first post here

I have windows-xp and setup MySql and php and everything is working fine but I was trying to find out how to change the user name and password for logging into Mysql, the default username is "root" and the password is empty, but I want to change them so that they are the same username and password that I used on my webhost....can someone help I've been trying to find the solution but I could not.

thank you
Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
Old
mdhall's Avatar
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
One option is to download and install phpMyAdmin. Not only can you add and edit users and their permissions, you can set up new databases easily, as well as tables, insert, edit and delete rows, etc. And its fairly simple to use, as well as free.
Reply With Quote
  #3 (permalink)  
Old
Newbie Coder
 
Join Date: Nov 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Done

Thank you mdhall for your response,

I finally figured out how to do it, here it goes:

on your command prompt and at the mysql\bin directory type the following:

c:\mysql\bin>mysql --user=root mysql

this will log you into mysql as the root user, which is the default user, then type the following:

mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

this will add the new user and setup the privileges of that user.

the source for this information is at:
http://www.mysql.com/doc/en/Adding_users.html

For editing and manipulating databases I highly recommend "MySQL-Front" which is a very neat program for handling MySQL databases

good luck and thank you again
Reply With Quote
  #4 (permalink)  
Old
Wannabe Coder
 
Join Date: Nov 2003
Posts: 191
Thanks: 0
Thanked 1 Time in 1 Post
you can also run winmysqladmin to do some simple admin tasks (you can find the executable in the \bin subdirectory)
Reply With Quote
  #5 (permalink)  
Old
New Member
 
Join Date: Feb 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
I have just installed MYSQL 4.0.17 on Win XP.

I tried to access the database using phpMyadmin but it didnt like the username or/and password no matter what I changed it too in config.inc.php.

I realised that I hadn't set the username and password when I first opened WinMySQLAdmin.

To create a username and password i found out that when you open up WinMySQLAdmin it looks for my.ini and if it exists the first box doesn't ask you for a username and password.

So to set one you have;

Firstly close down WinMySQLAdmin if it is running
Then rename the existing my.ini in the windows directory
And then start up WinMySQLAdmin again.

The first pop up will ask you for the username and password.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
PHP to MySQL script question...(using a field to update info in MySQL) DisneyFan25863 PHP 4 11-02-03 03:31 AM
mysql to access aspuser25 Database 2 09-16-03 11:01 AM
mysql v2UK ASP 2 08-18-03 08:50 PM


All times are GMT -5. The time now is 08:52 AM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.