MySql primer
  1. Using ssh or putty or something similar, log onto satoshi.cis.uncw.edu using your UNCW credentials, i.e. username and password. If you don't have putty on your machine, it is a free download. If you are off campus, you will have to VPN in to access satoshi.
  2. At the shell prompt, start the mySql client as mysql -p. Log in to the mySql server using your assigned password that you received from our system administrator at your UNCW email account. Each student has a separate database account. So your database will not conflict with other student databases.
  3. show databases; will show databases available to you. You will notice that one of the databases is named with your username.
  4. Connect to your database using use databaseName;, as in use abc1234;
  5. Create one or more tables and add data to the tables. See the university database example on the course Web site, and chapter 3 in your book for examples. Each sql statement is terminated by a semi-colon.
  6.         create table customer
               (customerName char(20) not null,
                 customerStreet char(30),
                 customerCity char(30),
                 primary key (customerName));


            insert into customer
                values('Smith', 'Pine', 'Wilmington');
  7. Write queries to retrieve data from the tables. As in, select * from customer;
  8. At the mySql prompt you can use source inputFileName to have the mySql server read and execute the sql commands contained in the specified file.
  9. At the mySql prompt you can use tee outputFileName to have the mySql server direct all output to the specified file. You will also see the output on your screen. Use notee to reset output to the standard output.
  10. At the mySql prompt type in help for a list of mySql server commands.
  11. At the mySql prompt you can use set password = password("newPassword"); to change your mySql password. This option may be disabled for your account.
  12. If you need to transport your database, tables, data and all: