Page 1 of 1
Creating users in mysql shell
Posted: Thu Jan 20, 2005 10:08 pm
by Steveo31
I'm having problems in the mysql shell creating anything. I've tried all the commands that I've come across
Code: Select all
C:\phpdev\mysql\bin\mysql -p -u root;
Enter Password:
Root shouldn't need a pass right off the bat, but ARG! Any way I can reset the server? I can't do it through the shell cause I cant set privilages!!!
Please help

Posted: Fri Jan 21, 2005 5:15 am
by timvw
rtfm? :p there is a whole section dedicated to it (or was it in the faq?)
Code: Select all
mysql -u root -p;
create table foo;
grant all on foo.* to 'user'@'localhost' identified by 'hispassword';
mysqladmin -u root -p reload
Posted: Fri Jan 21, 2005 1:56 pm
by Steveo31
Code: Select all
mysql -u root -p
Enter Password:
ERROR 1045(28000): Access denied for user: 'root'@'localhost' <using password: NO>
Same for it with a password. I think I need to completely reset the privileges for mysql somehow.
Posted: Fri Jan 21, 2005 1:59 pm
by feyd
I seem to remember fixing my problem with this by not even specifying a user, and switching it once I got in..

Posted: Fri Jan 21, 2005 2:19 pm
by Steveo31
Code: Select all
mysql -u
mysql option '-u' requires an arguement
Posted: Fri Jan 21, 2005 2:22 pm
by feyd
I meant:
Code: Select all
feyd@devnetwork ~/devnetwork
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.20a-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Posted: Fri Jan 21, 2005 6:18 pm
by Steveo31
OK, not sure what you mean by that.
I downloaded the next stable version of MySQL, 4.1.9. I was able to get it installed and started with
But when I try to connect with
Code: Select all
C:\phpdev\mysql\bin\>mysqld -u root
it gives me an error
Code: Select all
Microsoft Windows XP їVersion 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>cd c:\phpdev\mysql\bin
C:\phpdev\mysql\bin>mysqld
C:\phpdev\mysql\bin>mysqld -u root
Can't start server: Bind on TCP/IP port: No error
050121 16:12:19 Do you already have another mysqld server running on port: 3306
?
050121 16:12:19 Aborting
050121 16:12:19 mysqld: Shutdown Complete
phpMyAdmin works fine, so the server is technically there, I just can't access it through the shell.
my.cnf if it helps:
Code: Select all
#This File was made using the WinMySQLAdmin 1.4 Tool
#4/15/2004 1:37:09 AM
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
їmysqld]
basedir=C:/phpdev/mysql
#bind-address=172.198.119.3
datadir=C:/phpdev/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
їWinMySQLadmin]
Server=C:/phpdev/mysql/bin/mysqld-nt.exe
user=root
password=
їmysqld]
basedir=C:/phpdev/mysql
datadir=D:/phpdev/mysql/data
C:\phpdev\mysql\bin>
Posted: Fri Jan 21, 2005 6:36 pm
by Steveo31
Well, somehow mysql.exe and mysqladmin.exe were deleted

I restored em and all is good. Whew

Posted: Fri Jan 21, 2005 8:20 pm
by feyd
mysqld = MySQL Daemon Service.. i.e. server.

Posted: Sat Jan 22, 2005 2:16 am
by Steveo31
Ah... good to know. Ha, thanks
Any good links you have for something like this in the future?