![]() |
![]() Spring Semester 2007 |
Recall these steps are to be followed from the book (pp. 47-50).
Start by making sure you have a nobackup
folder.
Copy the file from
Move in the folder created by/l/www/classes/a348/sum2006/software/mysql*
tar
and run these commands:
When this is done, configure MySQL as follows:./configure --prefix=/nobackup/[username]/mysql make make install
With the server configured run this (make it a script) to start the server:/nobackup/[username]/mysql/bin/mysql_install_db \ --user=[username] \ --datadir=/nobackup/[username]/mysql
You can call the above/nobackup/[username]/mysql/bin/mysqld_safe \ --user=[username] \ --pid-file=/nobackup/[username]/mysql/mysqld.pid \ --log=/nobackup/[username]/mysql/mysqld.log \ --socket=/nobackup/[username]/mysql/mysql.sock \ --basedir=/nobackup/[username]/mysql \ --datadir=/nobackup/[username]/mysql \ --port=[your assigned mysql port] &
mysql_start
and put it in ~/bin
to refer to it again later, when needed. Change the root password:
Make a note of the password. I suggest we all use/nobackup/[username]/mysql/bin/mysqladmin \ --port=[your port] \ --socket=/nobackup/[username]/mysql/mysql.sock \ -u root password '[password]'
passw0rd
for simplicity. Now create yourself as an user:
Again, I think you need to make a note of your password.bash-3.00$ cat ~/bin/root mysql --socket=/nobackup/[username]/mysql/mysql.sock \ --port=[your port] -u root -p bash-3.00$ ./root Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.22-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> create user '[username]'@'silo.cs.indiana.edu' IDENTIFIED BY '[password]'; Query OK, 0 rows affected (0.00 sec) mysql> create database demoOne; Query OK, 1 row affected (0.03 sec) mysql> grant all on demoOne.* to '[username]'@'silo.cs.indiana.edu'; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye bash-3.00$
I suggest you use n0pass
. My password is in the book somewhere.
Now to stop the server you can do this:
With this you can go in and create tables in your database:/nobackup/[username]/mysql/bin/mysqladmin \ --socket=/nobackup/[username]/mysql/mysql.sock \ --port=[your port] -u root -p shutdown
This is taken from page 69, or so.bash-3.00$ mysql --socket=/nobackup/dgerman/mysql/mysql.sock \ --port=13297 --host=silo.cs.indiana.edu -u dgerman -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 to server version: 5.0.22-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use demoOne Database changed mysql> create table dgerman_accumulator ( -> session_id char(8) primary key, -> acc int, -> modified timestamp -> ); Query OK, 0 rows affected (0.03 sec) mysql> show tables; +---------------------+ | Tables_in_demoOne | +---------------------+ | dgerman_accumulator | +---------------------+ 1 row in set (0.01 sec) mysql> describe dgerman_accumulator; +------------+-----------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-----------+------+-----+-------------------+-------+ | session_id | char(8) | NO | PRI | | | | acc | int(11) | YES | | NULL | | | modified | timestamp | YES | | CURRENT_TIMESTAMP | | +------------+-----------+------+-----+-------------------+-------+ 3 rows in set (0.00 sec) mysql>
Now you can start entering data using insert
:
insert into dgerman_acc (session_id, acc) values ('aabbccdd', 23);