[categories] [index] [all (531)] [latest]
mysql> ALTER TABLE my_table ADD FULLTEXT(my_col);
This doesn't work on InnoDB tables, but only on MyIsam ones.
SELECT *
FROM my_table
WHERE MATCH (my_col)
AGAINST('my_text');
mysql> ALTER TABLE nm_newsitem ADD CONSTRAINT unique_link UNIQUE (link(255));
mysql> ALTER TABLE my_table ADD INDEX(my_col);
mysql> ANALYZE TABLE my_table;
mysql> USE my_db;
$ mysql -u user_name -p
mysql> DESCRIBE my_table;
mysql> SHOW TABLES;
$ mysqldump --opt --user=username --password database > dumpfile.sql
$ mysqldump --user my_user --password=my_password database > dumpfile.sql
$ mysqldump --no-data --opt --user=root --password news_memory > tables.sql
$ mysql --user=username --password database < dumpfile.sql
mysql> INSERT INTO my_table VALUES ('','France','fr');
$ /usr/local/mysql/bin/mysqladmin -u root password xxxxxxxx
mysql> UPDATE my_table SET my_table.my_row_1 = 'Lausanne' WHERE my_table.my_row_2 = 2338;
mysql> OPTIMIZE TABLE my_table;
ALTER TABLE my_table AUTO_INCREMENT=1;
The value is the one that will be used next.
update <table> set <champ> = replace(<champ>,'<avant>','<apres>');
$ sudo mysqld_safe --user=root &
$ mysqladmin -u root --password=xxxxxxxx shutdown
Since version 4.1, MySQL stores password in a new way.
Previous clients can't authenticate anymore.
As a workaround, you can update user passwords in mysql.user table:
mysql> UPDATE mysql.user SET password = OLD_PASSWORD('password') WHERE user = 'xxx' and host = 'xxx';
mysql> FLUSH PRIVILEGES;
Since MySQL 4.1 :
mysql> ALTER TABLE ma_table MODIFY ma_colonne CHAR(150) CHARACTER SET utf8;