vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I am very new to MySQL. I have downloaded and installed the " mysql-essential-5.0.41-win32.msi" version for Windows XP. After installation and instance configuration, the following thing runs fine: mysql -u root -p Enter password: ********* -- gets me to the mysql prompt and the following things also work fine mysql> create database test_dev Query OK, 1 row affected <0.00 sec> mysql> grant all on test_dev.* to 'root'@'localhost'; (this works fine, but 'kapil'@'localhost' in its place gives ERROR 1133) Query OK, 1 row affected <0.01 sec> (this means that the mysql server is up and running) I then write a small create.sql file, in the child folder db/create.sql: drop table if exists products; create table products ( id int not null auto_increment, primary key (id) ); The problem now comes when i write the following command: cwd>mysql test_dev <db/create.sql It now gives me the following error message: ERROR 1045 <28000>: Access denied for user 'ODBC'@'localhost' <using password: NO> I have tried looking for some responses online, but most of them said that the problem is related to root user and password etc., but I guess I am able to login to the mysql prompt. I also tried the following ( and got error !!): cwd>mysqladmin ping mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'ODBC'@'localhost' <using password: NO>' Confused as to what is going on !! Sorry for making it too long, but just wanted to make it as clear as possible from my side. Any help will be most appreciated. Thanks, Kapil -- I can sum up everything i learned about life in three words -- IT GOES ON !! |
| |||
| You are attempting to login as ODBC If your scripts are using ODBC as the USER you will need to CREATE USER ODBC and GRANT necessary privs doc available at http://dev.mysql.com/doc/refman/5.0/...ing-users.html M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. ----- Original Message ----- From: "kapil kaushik" <kaushik.kapil@gmail.com> To: <mysql@lists.mysql.com> Sent: Sunday, July 08, 2007 4:07 PM Subject: MySQL and 'ODBC'@'localhost' error > Hi, > > I am very new to MySQL. I have downloaded and installed the " > mysql-essential-5.0.41-win32.msi" version for Windows XP. > After installation and instance configuration, the following thing runs > fine: > > mysql -u root -p > Enter password: ********* > > -- gets me to the mysql prompt and the following things also work fine > > mysql> create database test_dev > Query OK, 1 row affected <0.00 sec> > mysql> grant all on test_dev.* to 'root'@'localhost'; (this works fine, > but > 'kapil'@'localhost' in its place gives ERROR 1133) > Query OK, 1 row affected <0.01 sec> > > (this means that the mysql server is up and running) > I then write a small create.sql file, in the child folder db/create.sql: > > drop table if exists products; > create table products ( > id int not null auto_increment, > primary key (id) > ); > > The problem now comes when i write the following command: > cwd>mysql test_dev <db/create.sql > > It now gives me the following error message: > ERROR 1045 <28000>: Access denied for user 'ODBC'@'localhost' <using > password: NO> > > I have tried looking for some responses online, but most of them said that > the problem is related to root user and password etc., but I guess I am > able > to login to the mysql prompt. I also tried the following ( and got error > !!): > > cwd>mysqladmin ping > mysqladmin: connect to server at 'localhost' failed > error: 'Access denied for user 'ODBC'@'localhost' <using password: NO>' > > Confused as to what is going on !! > > Sorry for making it too long, but just wanted to make it as clear as > possible from my side. Any help will be most appreciated. > > Thanks, > Kapil > > -- > I can sum up everything i learned about life in three words -- IT GOES ON > !! > |
| |||
| kapil kaushik wrote: > Hi, > > I am very new to MySQL. I have downloaded and installed the " > mysql-essential-5.0.41-win32.msi" version for Windows XP. > After installation and instance configuration, the following thing runs > fine: > > mysql -u root -p > Enter password: ********* > > -- gets me to the mysql prompt and the following things also work fine > > mysql> create database test_dev > Query OK, 1 row affected <0.00 sec> > mysql> grant all on test_dev.* to 'root'@'localhost'; (this works fine, > but > 'kapil'@'localhost' in its place gives ERROR 1133) > Query OK, 1 row affected <0.01 sec> > > (this means that the mysql server is up and running) > I then write a small create.sql file, in the child folder db/create.sql: > > drop table if exists products; > create table products ( > id int not null auto_increment, > primary key (id) > ); > > The problem now comes when i write the following command: > cwd>mysql test_dev <db/create.sql > > It now gives me the following error message: > ERROR 1045 <28000>: Access denied for user 'ODBC'@'localhost' <using > password: NO> > > I have tried looking for some responses online, but most of them said that > the problem is related to root user and password etc., but I guess I am > able > to login to the mysql prompt. I also tried the following ( and got error > !!): > > cwd>mysqladmin ping > mysqladmin: connect to server at 'localhost' failed > error: 'Access denied for user 'ODBC'@'localhost' <using password: NO>' > > Confused as to what is going on !! > > Sorry for making it too long, but just wanted to make it as clear as > possible from my side. Any help will be most appreciated. > > Thanks, > Kapil > You need to append the -u and -p options to all of the commands in order to use the correct credentials to run the script or mysqldump or any of the client utilities. BTW, root has all access to all databases, no need to run the grant for root. The grant error when properly logged in is due to the fact that the user doesn't exist. Add the "identified by 'password'" clause to create the user or create the user by hand before running the script. Adam |
| |||
| You didn't specify a user or password on your mysql command line when you redirected your input to your .sql file, and for some reason the default is ODBD@localhost. You need to use the -p and -u options on the command line. Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com |
| |||
| Hi All, Thanks a lot for your help. The thing is working now. Although I would like to mention a couple of points: 1. mysql -u root -p test_dev <db/create.sql -- simply works !! 2. Another way as people suggested to make it work was to give permissions to user ODBC. I was not being able to do this earlier(as i had mentioned in my mail that i could give permissions to new user) but I figured out later(thanks to Martin's link !!) that the problem was due to the "enable strict mode" option which I had checked in during installation. So, for a shortcut, I simply uninstalled and re-installed MySQL, this time with this option, and I could now add new users !! Also now, I did not need use [1] to access the db/create.sql file, my earlier command works fine Thanks again for the support !! Kapil On 7/9/07, Jerry Schwartz <jschwartz@the-infoshop.com> wrote: > > You didn't specify a user or password on your mysql command line when you > redirected your input to your .sql file, and for some reason the default > is > ODBD@localhost. > > You need to use the -p and -u options on the command line. > > Regards, > > Jerry Schwartz > The Infoshop by Global Information Incorporated > 195 Farmington Ave. > Farmington, CT 06032 > > 860.674.8796 / FAX: 860.674.8341 > > www.the-infoshop.com > www.giiexpress.com > www.etudes-marche.com > > > > > -- I can sum up everything i learned about life in three words -- IT GOES ON !! |
| ||||
| kapil kaushik wrote: > Hi All, > > Thanks a lot for your help. The thing is working now. Although I would like > to mention a couple of points: > 1. mysql -u root -p test_dev <db/create.sql -- simply works !! > 2. Another way as people suggested to make it work was to give permissions > to user ODBC. I was not being able to do this earlier(as i had mentioned in > my mail that i could give permissions to new user) but I figured out > later(thanks to Martin's link !!) that the problem was due to the "enable > strict mode" option which I had checked in during installation. So, for a > shortcut, I simply uninstalled and re-installed MySQL, this time with this > option, and I could now add new users !! > Also now, I did not need use [1] to access the db/create.sql file, my > earlier command works fine > > Thanks again for the support !! > Kapil > > On 7/9/07, Jerry Schwartz <jschwartz@the-infoshop.com> wrote: >> >> You didn't specify a user or password on your mysql command line when you >> redirected your input to your .sql file, and for some reason the default >> is >> ODBD@localhost. >> >> You need to use the -p and -u options on the command line. >> >> Regards, >> >> Jerry Schwartz >> The Infoshop by Global Information Incorporated >> 195 Farmington Ave. >> Farmington, CT 06032 >> >> 860.674.8796 / FAX: 860.674.8341 >> >> www.the-infoshop.com >> www.giiexpress.com >> www.etudes-marche.com >> >> >> >> >> > > Just be weary of the security risk. Adam |