The K Desktop Environment

Next Previous Table of Contents

4. Working on a mysql-server

First comment: 'cause the mysql - is running under WindowsNT, too, kmysqladmin compares all table-/database-/ column-names caseinsensitive. Means, for kmysqladmin is "Test" exactly the same like "test". And I believe, it would be better, you don't make difference between column/table/database names only trough the case of the words.

If your connected to the sql-server, all other buttons/menu-entries will be enabled. I can not check if you have the rights to do something on the server, so all is enabled. The server itself will check your privileg to do something. So it is possible, that you get an error

Access denied for user: 'test@localhost' (Using password: NO)
or such if you do something you don't have no rights for.

4.1 Creating a new database

Simply click on "new DB" in the mainwindow and enter the name of the new database. When you click "OK", kmysqladmin will generate a (non logged) "CREATE database" - statement.

4.2 Creating tables

Click on "create table" inside the main window and a dialog comes up where you can enter all needed informations.

First you have to select an existing database where you want to create the new table. In the upper-right textfield you can now enter a table-name. If a table with this name exists, all other elements are disabled.

For each column do following:

You can correct a column by selecting it in the right list, make your changes and click the "Modify" button.

Compound keys

If you have more than one column in your list, you can create compound keys. Click on "compound" to build them. First, enter a name for a key or select one from the table left in the dialog. Check the type of the key and - if a new an - klick "add key". Now set the key type you want. In the middle of the dialog you can see a list of columns of the table. Mark one and click on the arrow showing to the right table. In these table are the columns building this key. You can remove one column from the key, when you mark it in the right table and click the arrow pointing to the left. All modifications are directly made on the key-list. So you can simply close the dialog when finished.

After finished your wishes, click on the "Create" - button. Kmysqladmin tries to generate a correct sql-statement and send it to the sql-server. If someone goes wrong, a messagebox appears and the dialog will not be closed. Inside the log-window you can see, what kmysqladmin tried and what the server thought about this statement. Sometimes some constructs failed, 'cause kmysqladmin isn't able to check all possibilities. (And I don't want to write a parser again like mysql has ;)

4.3 Alter tables

Altering tables works most like the creation of tables. One difference - you can not enter a new tablename. Start the dialog, select database and table of database. Then make you changes and after finish them, click the "Alter" button. If the ALTER - statement fails, the dialog will not close and you can see a errormessage inside the log-window.

4.4 Renaming tables

Select "Database" -> "Rename table..." and a little dialog comes up, where you can select a database and a table. Enter the new name and press "Change name". If the new name already exists in the database, this button is disabled. After them, it will generate a "ALTER TABLE RENAME <name> AS <newname>" statement and tries to execute it.

Next Previous Table of Contents