Question:
Where should i write sql commands?
bornconfused
2008-03-28 11:03:49 UTC
I'm new to databases, and would like to use MySQL to learn.
I'm a linux user and would like to use linux (ubuntu) for MySQL but i can't figure out how and where to type the SQL commands. I dont know which software to install.
I installed MySQL server but i cant seem to get it to start.
There is no option present to execute it and i dont even know if that's where i can type the commands!
Three answers:
no1home2day
2008-03-28 11:10:39 UTC
You need something like SQL Studio.



Or, if you are programming in one of the .NET languages, you can include it in your code:



Dim Sql AS String = "SELECT * FROM Table"



Then after you connect to the database in MySql, you then use something like



Dim Tbl as new DataTable

etc.



Sorry, off the top of my head I don't remember how to connect to the table. It will probably come to me tonight at 2:00 in the morning! (*sigh*)
mapighimagsik_so
2008-03-28 18:13:11 UTC
just connected to your mySQL server instance with your client, and you're off and running.
Syed
2008-03-28 18:11:03 UTC
Go to http://www.mysql.com/ and download the mysql package

- to install this directly on the command line type:

- cd /usr/local

- wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-4.0/mysql-4.0.27.tar.gz

# http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-5.0/mysql-5.0.41.tar.gz

- gunzip mysql-4.0.27.tar.gz

- tar xvf mysql-4.0.27.tar

- cd mysql-4.0.27

- groupadd mysql

- useradd -g mysql mysql

- ./configure --prefix=/usr/local/mysql --enable-large-files --enable-shared=yes --with-readline

**** If only MySQL client is needed for DBD::mysql then use this:

- ./configure --prefix=/usr/local/mysql --without-server --enable-shared=yes --with-readline

**** If using version 5 tree MySQL client then use this:

- ./configure --prefix=/usr/local/mysql --without-server --enable-shared=yes --with-readline --enable-thread-safe-client

- make

- make install

- scripts/mysql_install_db

- chown -R root /usr/local/mysql

- chown -R mysql /usr/local/mysql/var

- chgrp -R mysql /usr/local/mysql

- cp support-files/my-medium.cnf /etc/my.cnf

- /usr/local/mysql/bin/mysqld_safe --user=mysql &

- ln -s /tmp/mysql.sock /var/run/mysql/mysql.sock



After installing and running MySQL, type mysql and hit enter you'll be in mysql shell where you can type queries.

Good luck!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...