mySQL Cheat Sheet
With root priviledges run mysql_install_db (this is in /usr/bin/) this will setup the mySQL basics and create a database called "test".
Use "service configuration" to start mysqld.
Set the root password via:
mysqladmin -u root password new_password
mysql -u root mysql
SET PASSWORD FOR root@localhost=PASSWORD("new_password");
Databases reside in /var/lib/mysql
A list of databases can be obtained by:
mysqlshow -u root - -password
(this will use the user "root" and prompt for the password)
To connect to the server (from Linux command line) use:
mysql -u root -p
<hit enter and you will be prompted for the mysql user "root"s password>
To create a database:
CREATE DATABASE newDataBase;
Creating a "user" and granting them access is CLUMSY. (this is done
while connected to the server via SQL statements) Essentially it is:
GRANT ALL PRIVILEGES ON *.* TO email@example.com IDENTIFIED BY password' WITH GRANT OPTION;
Full process for creating a user with unlimited abilities on a database:
mysql -u root --password
GRANT ALL PRIVILEGES ON *.* TO firstname.lastname@example.org IDENTIFIED BY
password' WITH GRANT OPTION;
Note, server is in the form: "jdbc:mysql://192.168.0.231/"
driver is "org.gjt.mm.mysql.Driver"; "mm.mysql-2.0.14-bin.jar" must be in the class path.
Stray notes (contradictory to published instructions):
Useless: shell> ./bin/safe_mysqld --user=mysql &
Instead use "service configuration" to start it.
"mysql.server" - is in /usr/share/mysql/ and appears to be a start
up script. RedHat seems to have this all working fine by default, all you need
to do is start the mysql via "service configuration".