Author Topic: Help I've fallen out of the database, and I can't get up.  (Read 2585 times)

lmwashere

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Help I've fallen out of the database, and I can't get up.
« on: February 22, 2010, 04:59:26 pm »
So this morning I went to transfer a movie from my laptop to the public folder of my linuxmce hybrid. When I tried to open the folder on the Hybrid it prompted me for the password. Well, alright, so I entered it. No joy. I then went on to enter every username and password combination on the machine. Nothing.

Try ssh, that works with the kde password like it should.

Try to login to webadmin, nothing with any username and password combination.

I found a post on resetting the password for the webadmin, and found that there seem to be no users in the mysql database. Here are the terminal results and the article I was following:

http://wiki.linuxmce.org/index.php/Reset_the_password_for_the_LinuxMCE_Admin_site


josh@lmwashere-PC ~ $ ssh 192.168.1.150
josh@192.168.1.150's password:
Linux dcerouter 2.6.27-16-generic #1 SMP Tue Dec 1 17:56:54 UTC 2009 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Mon Feb 22 10:27:05 2010 from 192.168.1.152
josh@dcerouter:~$ mysql pluto_main -u root
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 122614
Server version: 5.0.67-0ubuntu6 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select * FROM Users
    -> update Users set Password=md5("josh") where UserName="josh"; quit;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update Users set Password=md5("josh") where UserName="josh"' at line 2
Bye
josh@dcerouter:~$ mysql pluto_main -u root
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 122647
Server version: 5.0.67-0ubuntu6 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select * FROM Users
    -> select * FROM Users update Users set Password=md5("josh") where UserName="josh";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * FROM Users update Users set Password=md5("josh") where UserName="josh"' at line 2
mysql>



Interestingly, if I go to the setup wizard, my username is still in there.

Any help would be very appreciated.

Thanks,
josh

jimbodude

  • Guru
  • ****
  • Posts: 372
    • View Profile
Re: Help I've fallen out of the database, and I can't get up.
« Reply #1 on: February 22, 2010, 05:38:40 pm »
Your analysis of the situation isn't quite correct...

mysql> select * FROM Users
    -> update Users set Password=md5("josh") where UserName="josh"; quit;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update Users set Password=md5("josh") where UserName="josh"' at line 2
Bye

What you've done here is run one incorrect query where you meant to run 2 distinct queries.  See how on the second line the "mysql>" has turned into a "->"?  This means MySQL is still waiting for you to tell it that you're done with this query.  All queries end with a ";".

Since you didn't do that, you didn't list the users, and you didn't update the password.  Try this instead:
Code: [Select]
SELECT * FROM Users;

And assuming that you'd like to change the password associated with username "josh":
Code: [Select]
UPDATE Users SET Password=md5("josh") WHERE UserName="josh";

Then to exit the MySQL console:
Code: [Select]
quit

lmwashere

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: Help I've fallen out of the database, and I can't get up.
« Reply #2 on: February 24, 2010, 03:18:53 pm »
Thanks,

comes with being a rookie

josh


jimbodude

  • Guru
  • ****
  • Posts: 372
    • View Profile
Re: Help I've fallen out of the database, and I can't get up.
« Reply #3 on: February 24, 2010, 04:10:58 pm »
got to start somewhere  ;)