Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
mysql [2008/03/14 12:55] greebo |
mysql [2012/10/11 20:57] 94.23.1.28 EHNvAaHEfVFkEd |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== MySQL (*nix setup) ====== | + | You know, the thing about SQL is, that there is virtually noithng that can replace it.Does anyone know if a substitute exists for sql? I mean besides MS SQL and Oracle and all that jazz. Thanks. |
- | + | ||
- | * [[mysql: | + | |
- | + | ||
- | //TODO | + | |
- | // | + | |
- | + | ||
- | + | ||
- | - shutdown MySQL | + | |
- | - start MySQL with `mysqld_safe --skip-grant-tables &` | + | |
- | - set password either with : | + | |
- | `mysqladmin -u root flush-privileges password " | + | |
- | or | + | |
- | `mysql -u root mysql` | + | |
- | + | ||
- | Issue the following commands in the mysql client: | + | |
- | mysql> UPDATE mysql.user SET Password=PASSWORD(' | + | |
- | mysql> FLUSH PRIVILEGES; | + | |
- | + | ||
- | + | ||
- | GRANT ALL PRIVILEGES ON *.* TO myuser@localhost IDENTIFIED BY ' | + | |
- | + | ||
- | + | ||
- | ===== Convert | + | |
- | + | ||
- | | + | |
- | | + | |
- | mysql --user=username --password=password --execute=" | + | |
- | mysql --user=username --password=password --default-character-set=utf8 dbname < dump.sql | + | |
- | + | ||
- | + | ||
- | + | ||
- | ===== From MySQL 4.x (latin1) to MySQL 5.x (latin2) | + | |
- | + | ||
- | **variables: | + | |
- | + | ||
- | | ^ MySQL 4.1 ^ MySQL 5.x ^ | + | |
- | | character_set_client | + | |
- | | character_set_connection | + | |
- | | character_set_database | + | |
- | | character_set_results | + | |
- | | character_set_server | + | |
- | | character_set_system | + | |
- | | collation_connection | + | |
- | | collation_database | + | |
- | | collation_server | + | |
- | + | ||
- | # mysqldump --default-character-set=latin1 -skip-set-charset --create-options -n -c --opt > shema | + | |
- | # mysqldump --default-character-set=latin1 --skip-set-charset --create-options -n -c --extended-insert -t > data | + | |
- | # sed -i " | + | |
- | # cat shema| mysql --default-character-set=utf8 | + | |
- | # cat data| mysql --default-character-set=latin2 | + | |
- | + | ||
- | === InnoDB === | + | |
- | [mysqld] | + | |
- | default-storage-engine=innodb | + | |
- | innodb_file_per_table=1 | + | |
- | innodb_flush_log_at_trx_commit=0 | + | |
- | innodb_thread_concurrency=2 | + | |
- | + | ||
- | + | ||
- | To convert tables | + | |
- | alter table mytable type=innodb; | + |