This forum is no longer active. Please post your questions to our new community site

Forums LAMPStack

Using mysql alone on command line

Subscribe to Using mysql alone on command line 2 post(s), 2 voice(s)

Avatar tintsu 1 post

I installed LAMStack on Ubuntu 10.10 and it is working fine via browser, eg. I can create tables on test database using phpMyAdmin. But can I use mysql alone via command prompt? How could I end up in a situation, where one can write eg. SELECT * FROM cat on command line? I mean typical sql usage without network. Is there help on some wiki on this?

tiina@tiina:~/lampstack-1.2-3$ ./ start mysql
101109 12:21:24 mysqld_safe Logging to ‘/home/tiina/lampstack-1.2-3/mysql/data/mysqld.log’.
101109 12:21:24 mysqld_safe Starting mysqld.bin daemon with databases from /home/tiina/lampstack-1.2-3/mysql/data
/home/tiina/lampstack-1.2-3/mysql/scripts/ : mysql started at port 3306
tiina@tiina:~/lampstack-1.2-3$ SELECT * FROM cat
SELECT: command not found

Did I make a mistake by chmod u+x *bin instead of chmod 755 *bin before installing?



Avatar Beltrán Rueda Administrator 3,714 post(s)


You should start the “use_lampstack” console before using the Stack commands. Try the following:

$ cd lampstack-1.2-3
$ ./use_lampstack
$ mysql -u root -p

(the password is the same that you set during the installation)

Once you login in the MySQL database you can run any command:

mysql> show databases;
mysql> use your_database;
mysql> SELECT * from YOUR_TABLE;

I hope it helps.

Forums LAMPStack