Forum Moderators: coopster

Message Too Old, No Replies

mysql - how to get to the shell

deleted all user need to repair it. what programm do i uset?

         

ikbenhet1

5:58 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



I need to get "to the shell". How do i get to the shell? The manual writes that i should use telnet.
I have used putty,hyperterminal and a few more in the dmoz-list, what programm do you recommend?

thank you.

NickCoons

6:02 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



Telnet works, but SSH would be more secure if you're going over the internet (instead of to a machine on the LAN). I use SecureCRT. It supports these protocols and more.

ikbenhet1

6:21 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



the programm reported "shell acces is not allowed", while the other programms just crashed or quit. Thanks for pointing me to this programm.

So i gues i will have to contact my host to repair the users. They've not responded to my last 4 emails yet, i should never have taking the dedicated server with this crappy host.

killroy

6:23 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



why not jsut use the mysql.exe shell client? I use it all the time, 24/7 to stay conneted to both remote and local servers. I'm sure there is the equivalent for linux too.

SN

ikbenhet1

6:33 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



Where can i find mysql.exe shell for linux?

So if i have deleted all mysql-users (including ROOT [i can't access phpmyadmin because of this]) i can restore the users with a linux equalivent of mysql.exe shell?

Thank you.

[edited by: ikbenhet1 at 6:33 pm (utc) on Jan. 2, 2004]

ergophobe

6:33 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Killroy, his host probably only allows http connections, so I doubt he can use his local client to connect to a remote site if he doesn't have shell access.

I also suspect that his host has some sort of provision for this situation, such as phpMyAdmin or something.

It's strange to me, though, if he doesn't have shell access that he would be able to do anything to the users (I assume we're talking 'user' in the 'mysql' table) except through some sort of control panel interface.

ikbenhet1

6:35 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



i had access to the users in phpmyadmin 2.5.1 .
under "priviliges" i can delete/add users.

But since i deleted all users i can't log into phpmyadmin anymore because mysql cannot connect using the username and password because they are deleted.

ps. i deleted them because root had no password, anybody could login using root and no password so i thought let me fix that.. so now i am here...sorry

killroy

6:41 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm you could also createa new user table locally and upüload it using FTP or whatever remote access you have.

SN

ikbenhet1

7:02 pm on Jan 2, 2004 (gmt 0)

10+ Year Member




My last post about this, is there a mysql direcory somewhere i should upload this to?

in the root i have these directory's:
[logs] - [users] - [web]- [web2]

I also have access to the "cobalt server administrator", is there somethink i can do from there?

I give up. Thanks to all for your suggestions. I'll go send the fifth email to the host and ask to allow me to the shell.

ikbenhet1

8:43 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



I found a way to execute mysql query's.
i executed:

mysql_query("INSERT INTO user VALUES('localhost','user',PASSWORD('pass'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')");
mysql_query("FLUSH PRIVILEGES");

this should work right? But it doesn't work, did i do something wrong?
thanks

jatar_k

8:44 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



does it give an error?

ikbenhet1

8:56 pm on Jan 2, 2004 (gmt 0)

10+ Year Member




no errors, i'm am executing it through a php file.

i'm gonna try to select the user table to see what data it gives back to me.

jatar_k

9:03 pm on Jan 2, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



on your query put

mysql_query($q) or die("<p>" . mysql_error());

that will give you the error from mysql if there is one.

ikbenhet1

9:09 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



the error: Table 'mydb.user' doesn't exist

am i allowed to create this table in mysql myself?
If so, is there documentation on what fields-names i should use?

jatar_k

5:31 pm on Jan 4, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



am i allowed to create this table in mysql myself?

I would say probably not on a shared host.

is there documentation on what fields-names i should use?

It should all be in here somewhere
MySQL User Account Management [mysql.com]

ikbenhet1

11:34 am on Jan 5, 2004 (gmt 0)

10+ Year Member




Jatar k, it a dedicated server, sorry i was not clear about this.

Ok, now i got shell access.
i still can't figure it out, help very MUCH appriciated.

i tried this to add a user:

root /root]# #!/bin/bash
bash:!/bin/bash: event not found
[root /root]# mysql --user=root mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
[root /root]# grant all privileges on *.* to $1@localhost;
bash: grant: command not found

what am i dooing wrong? thank you.

ikbenhet1

12:07 pm on Jan 5, 2004 (gmt 0)

10+ Year Member



ok grant not found is solved.
i did this: setenv /usr/local/mysql/bin:$path >> ~/.tcshrc and grant worked after that.

however i cannot succeed in adding a user!

grant all privileges on *.* to root@localhost
> grant all privileges on *.* to root@'%' identified by 'ikbenhet' WITH GRANT OPTION
> GRANT RELOAD, PROCESS ON *.* to root@localhost
> GRANT USAGE ON *.* root@localhost;
> GRANT USAGE ON *.* test@localhost;
> flush privileges

Why can i not login in phpmyadmin using : user: root & password: ikbenhet?

Thanks a million.

<added> it is resolved by the host, thank you all for your help, i really appriciate it.</added>