0

i am new to MySQL and php and i cannot seem to obtain a remote connection to mysql server via heidisql and i can get a connection via the command line shell included in the mysql client the following is the error message

SQL Error (1045) in statement #0: Access denied for user
'root'@'localhost' (using password: YES)  

this message occurred once i typed in -hlocalhost -uroot -pascent in the DOS box. Any pointers would be very much appreciated. Would i have to run the mysql_install_db script to initialise privilges as i am 100% sure my password is correct.

Robbert
  • 6,481
  • 5
  • 35
  • 61
user3461632
  • 83
  • 2
  • 13
  • Usually you need three basic things to connect to a DB, you need the IP address and port. You need a DB created with tables, and you need a user with properly granted permissions to the DB. – Frank Tudor Mar 25 '14 at 21:06
  • thats exactly what i do have as in port 3306 and ip 127.0.0.1 and they do consist of tables as well – user3461632 Mar 25 '14 at 21:09
  • add `-p` param for Password. – Adrian Preuss Mar 25 '14 at 21:09
  • IP, port, db, user; i think thats 4 ? –  Mar 25 '14 at 21:10
  • `Host`, `Port`, `Username`, `Password` and `Database` – Adrian Preuss Mar 25 '14 at 21:11
  • yes ive added those bits in and the error message occurs if i change the port to 3307 then it doesn't come up. – user3461632 Mar 25 '14 at 21:13
  • The default root password is blank `mysql -u root` <<< use that.. Then run `mysqladmin -u root password [newpassword]` <<< set a password. Look at this other stack post. http://stackoverflow.com/questions/21944936/error-1045-28000-access-denied-for-user-rootlocalhost-using-password-y – Frank Tudor Mar 25 '14 at 21:22
  • In the local mysql server, you need to create a specific user to connect from your remote ip, grants permissions on that user, and open the port to accept connection from remote users – Hackerman Mar 25 '14 at 21:22
  • i have just tried this and nothing has changed. however the previous answer was interesting is there an link you could point me towards – user3461632 Mar 25 '14 at 21:39
  • I don't understand your question... do you have problems connecting with the CLI or with HeidiSQL? or both? – PachinSV Mar 25 '14 at 21:43
  • heidisql. cli is fine and now ive just left the password blank and now it works so its a non issue now sorry for the confusion – user3461632 Mar 25 '14 at 21:48

0 Answers0