Linux » MySQL » management

management

Last modified by root on 14-43-2013

Change root password

mysqladmin -u root password "newpwd"

mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

GRANT SELECT,LOCK TABLES ON DBNAME.* TO 'username'@'localhost';

utf8 encoding

To set the default to UTF-8, you want to add the following to my.cnf

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
default-character-set = utf8    
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

ALTER TABLE Table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Database repair

#mysqlcheck -u moodleuser -p --auto-repair moodle

"Table ‘mysql.servers’ doesn’t exist"

1. mysql_upgrade -u root -p

2. mysql_fix_privilege_tables --user=root\ --password=mysqlpasswordhere --verbose

3.mysql> CREATE TABLE `servers` (
 `Server_name` char(64) NOT NULL,
 `Host` char(64) NOT NULL,
 `Db` char(64) NOT NULL,
 `Username` char(64) NOT NULL,
 `Password` char(64) NOT NULL,
 `Port` int(4) DEFAULT NULL,
 `Socket` char(64) DEFAULT NULL,
 `Wrapper` char(64) NOT NULL,
 `Owner` char(64) NOT NULL,
 PRIMARY KEY (`Server_name`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
 COMMENT=’MySQL Foreign Servers table’;

Tags:
Created by root on 03-26-2012

Spaces

 | Arduino | Blog | Dashboard | Java | Linux | Main | MulltiWii | NEAX2000 | Radio | VOIP


This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 3.5 - Documentation