Saturday, January 23, 2010

MySQL

C:\mysql\bin>mysqld --install install mysql server
C:\mysql\bin>mysqld --remove uninstall mysql server
start mysql open windows services and start mysql
C:\mysql\bin>mysql Invoke mysql client
C:\mysql\bin>mysql -u root login to local mysql as root (default password is blank)
select version(), user();Check mysql version, current user
show databases; Show all databases
use New_DB_Name;Chang DB
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';
grant all privileges on joomla.* to 'joomla'@'localhost';
CREATE DATABASE sonlmdb; create new db
mysql>use sonlmdb; select database
show tables;Show tables
describe tablename;show table's structure
connect to mysql by sqldeveloper
connect to mysql by using MySQL Query Browser
Create a new table: open MySQL Query Browser --> right click to the schema --> create new table
Execute scripts: connect by using sqldeveloper
show create table table_name\Gcreate table script
Generate schema's script: MySQL UI -> MySQL Administrator -> Backup

1 comment:

  1. Very helpful, thanks for this!

    Also check out my mysql code snippets and they might help you out!

    ReplyDelete