|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Posts: 332
|
How do I connect to my Web Host MySQL...
Hi, I know how I connect to my localhost MySQL database with;
cd /usr/local/mysql/bin/ and press enter. then type ./mysql -u root -p and press enter How do I connect to my Web Host MySQL through Terminal if for example: Server: mysql.madeup.net Database: me1 Username: me1 Password: mypasswd Thanks, Simon |
|
|
|
|
|
#2 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Posts: 332
|
I have gone into my database section via my web host, gone to create new database, typed in the name and got this:
SQL-query: Edit CREATE DATABASE `ijdb` ; MySQL said: Documentation #1044 - Access denied for user: 'simonbailey1@%' to database 'ijdb' |
|
|
|
|
|
#3 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2005
Posts: 912
|
use the -h option to specify the host
so it would be something like mysql -h mysql.madeup.net -u me1 -p [hit enter] then type your password then type connect me1 http://dev.mysql.com/doc/mysql/en/my...d-options.html |
|
|
|
|
|
#4 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Posts: 332
|
Hi,
I got this reply.. Last login: Sun Oct 2 22:32:07 on ttyp1 Welcome to Darwin! Simon-Baileys-Computer:~ SiBailey$ ./mysql -h mysql.madeup.net -u me1 -p -bash: ./mysql: No such file or directory Simon-Baileys-Computer:~ SiBailey$ mysql -h mysql.madeup.net -u me1 -p -bash: mysql: command not found |
|
|
|
|
|
#5 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2005
Posts: 912
|
if you are connecting to your host via ssh or telnet then you don't need to specify the host option because then the mysql server is on the same computer.
why are you using ./mysql you should only be using that if you are in the same directory as the msyql command is in. Typically you will have the /usr/bin or whever mysql is in your path and you shouldn't have to cd to the mysql directory in order to connect to it.. just try mysql -u yourusername -p and not ./mysql using . means you are referring to a file in the current directory. |
|
|
|
|
|
#6 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Posts: 332
|
Quote:
)I will try the above code, thanks. Simon ![]() |
|
|
|
|
|
|
#7 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Posts: 332
|
Quote:
I tried it and it just came up with bad command. Think I'm just gonna give up on this and sell bannanas at some stall. Since I got this sitepoint book, I have followed what it says to do precisely but still no joy ![]() Thank you for all your help mwolfe ![]() Simon |
|
|
|
|
|
|
#8 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2005
Posts: 912
|
no giving up man, believe me i've pondered the benefits of selling bananas instead of programming many times.
if you look above, you posted the following : Quote:
what happened before this?? it looks to me like you must have connected to some server before this maybe you typed ssh www.yourhost.com or you typed telnet www.yourhost.com or something to that effect i havent worked on a mac much at all but on all the linux boxes i've worked on i've never seen a message like that when opening a terminal window, the only time i get those kind of messages is when i connect to another server.. But mabye yours does that when you open terminal automatically. its fairly likely, though, if you are trying to connect to mysql on your host, you can only do so from there computer.. Thus, you connect via ssh or telnet (whichever they support) they are pretty much the same thing only ssh is encrypted and is more secure. once you connect its basically the same thing as being on your own computer, except you will see what is on the servers computer. the mysql command should be in your local path, so you should be able to use mysql - u yourusername -p to connect to mysql from there.. goodluck man, and don't give up, i don't help people so they can give up (you are now obligated to fix it!! =) |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 13:35.






)



Linear Mode
