搜档网
当前位置:搜档网 › Mysql错误代码大全

Mysql错误代码大全

Mysql错误代码大全
Mysql错误代码大全

Mysql错误代码大全

Mysql错误代码

Mysql错误代码分为两部分,老版本一部分,4.1版本为新的部分

第一部分:

mysql的出错代码表,根据mysql的头文件mysql/include/mysqld_error.h整理而成1005:创建表失败

1006:创建数据库失败

1007:数据库已存在,创建数据库失败

1008:数据库不存在,删除数据库失败

1009:不能删除数据库文件导致删除数据库失败

1010:不能删除数据目录导致删除数据库失败

1011:删除数据库文件失败

1012:不能读取系统表中的记录

1020:记录已被其他用户修改

1021:硬盘剩余空间不足,请加大硬盘可用空间

1022:关键字重复,更改记录失败

1023:关闭时发生错误

1024:读文件错误

1025:更改名字时发生错误

1026:写文件错误

1032:记录不存在

1036:数据表是只读的,不能对它进行修改

1037:系统内存不足,请重启数据库或重启服务器

1038:用于排序的内存不足,请增大排序缓冲区

1040:已到达数据库的最大连接数,请加大数据库可用连接数

1041:系统内存不足

1042:无效的主机名

1043:无效连接

1044:当前用户没有访问数据库的权限

1045:不能连接数据库,用户名或密码错误

1048:字段不能为空

1049:数据库不存在

1050:数据表已存在

1051:数据表不存在

1054:字段不存在

1065:无效的SQL语句,SQL语句为空

1081:不能建立Socket连接

1114:数据表已满,不能容纳任何记录

1116:打开的数据表太多

1129:数据库出现异常,请重启数据库

1130:连接数据库失败,没有连接数据库的权限

1133:数据库用户不存在

1141:当前用户无权访问数据库

1142:当前用户无权访问数据表

1143:当前用户无权访问数据表中的字段

1146:数据表不存在

1147:未定义用户对数据表的访问权限

1149:SQL语句语法错误

1158:网络错误,出现读错误,请检查网络连接状况

1159:网络错误,读超时,请检查网络连接状况

1160:网络错误,出现写错误,请检查网络连接状况

1161:网络错误,写超时,请检查网络连接状况

1062:字段值重复,入库失败

1169:字段值重复,更新记录失败

1177:打开数据表失败

1180:提交事务失败

1181:回滚事务失败

1203:当前用户和数据库建立的连接已到达数据库的最大连接数,请增大可用的数据库连接数或重启数据库

1205:加锁超时

1211:当前用户没有创建用户的权限

1216:外键约束检查失败,更新子表记录失败

1217:外键约束检查失败,删除或修改主表记录失败

1226:当前用户使用的资源已超过所允许的资源,请重启数据库或重启服务器

1227:权限不足,您无权进行此操作

1235:MySQL版本过低,不具有本功能

第二部分新4.1.11,摘自DOCSmysqld_error.txt

character-set=utf-8 isher补充

#define ER_HASHCHK 1000

"hashchk",

#define ER_NISAMCHK 1001

"isamchk",

#define ER_NO 1002

"NO",

#define ER_YES 1003

"YES",

#define ER_CANT_CREATE_FILE 1004

"Can't create file '%-.64s' (errno: %d)",

#define ER_CANT_CREATE_TABLE 1005

"Can't create table '%-.64s' (errno: %d)",

#define ER_CANT_CREATE_DB 1006

"Can't create database '%-.64s' (errno: %d)",

#define ER_DB_CREATE_EXISTS 1007

"Can't create database '%-.64s'; database exists",

#define ER_DB_DROP_EXISTS 1008

"Can't drop database '%-.64s'; database doesn't exist",

#define ER_DB_DROP_DELETE 1009

"Error dropping database (can't delete '%-.64s', errno: %d)", #define ER_DB_DROP_RMDIR 1010

"Error dropping database (can't rmdir '%-.64s', errno: %d)", #define ER_CANT_DELETE_FILE 1011

"Error on delete of '%-.64s' (errno: %d)",

#define ER_CANT_FIND_SYSTEM_REC 1012

"Can't read record in system table",

#define ER_CANT_GET_STAT 1013

"Can't get status of '%-.64s' (errno: %d)",

#define ER_CANT_GET_WD 1014

"Can't get working directory (errno: %d)",

#define ER_CANT_LOCK 1015

"Can't lock file (errno: %d)",

#define ER_CANT_OPEN_FILE 1016

"Can't open file: '%-.64s' (errno: %d)",

#define ER_FILE_NOT_FOUND 1017

"Can't find file: '%-.64s' (errno: %d)",

#define ER_CANT_READ_DIR 1018

"Can't read dir of '%-.64s' (errno: %d)",

#define ER_CANT_SET_WD 1019

"Can't change dir to '%-.64s' (errno: %d)",

#define ER_CHECKREAD 1020

"Record has changed since last read in table '%-.64s'",

#define ER_DISK_FULL 1021

"Disk full (%s). Waiting for someone to free some space...", #define ER_DUP_KEY 1022

"Can't write, duplicate key in table '%-.64s'",

#define ER_ERROR_ON_CLOSE 1023

"Error on close of '%-.64s' (errno: %d)",

#define ER_ERROR_ON_READ 1024

"Error reading file '%-.64s' (errno: %d)",

#define ER_ERROR_ON_RENAME 1025

"Error on rename of '%-.64s' to '%-.64s' (errno: %d)",

#define ER_ERROR_ON_WRITE 1026

"Error writing file '%-.64s' (errno: %d)",

#define ER_FILE_USED 1027

"'%-.64s' is locked against change",

#define ER_FILSORT_ABORT 1028

"So瘀牡?剕????o鸞?rt aborted",

#define ER_FORM_NOT_FOUND 1029

"View '%-.64s' doesn't exist for '%-.64s'",

#define ER_GET_ERRNO 1030

"Got error %d from storage engine",

#define ER_ILLEGAL_HA 1031

"Table storage engine for '%-.64s' doesn't have this option",

#define ER_KEY_NOT_FOUND 1032

"Can't find record in '%-.64s'",

#define ER_NOT_FORM_FILE 1033

"Incorrect information in file: '%-.64s'",

#define ER_NOT_KEYFILE 1034

"Incorrect key file for table: '%-.64s'; try to repair it",

#define ER_OLD_KEYFILE 1035

"Old key file for table '%-.64s'; repair it!",

#define ER_OPEN_AS_READONLY 1036

"Table '%-.64s' is read only",

#define ER_OUTOFMEMORY 1037

"Out of memory. Restart daemon and try again (needed %d bytes)",

#define ER_OUT_OF_SORTMEMORY 1038

"Out of sort memory. Increase daemon sort buffer size",

#define ER_UNEXPECTED_EOF 1039

"Unexpected eof found when reading file '%-.64s' (errno: %d)",

#define ER_CON_COUNT_ERROR 1040

"Too many connections",

#define ER_OUT_OF_RESOURCES 1041

"Out of memory; Check if mysqld or some other process uses all available memory. If not you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", #define ER_BAD_HOST_ERROR 1042

"Can't get hostname for your address",

#define ER_HANDSHAKE_ERROR 1043

"Bad handshake",

#define ER_DBACCESS_DENIED_ERROR 1044

"Access denied for user: [email=]'%-.32s'@'%-.64s'[/email] to database '%-.64s'",

#define ER_ACCESS_DENIED_ERROR 1045

"Access denied for user: [email=]'%-.32s'@'%-.64s'[/email] (Using password: %s)",

#define ER_NO_DB_ERROR 1046

"No Database Selected",

#define ER_UNKNOWN_COM_ERROR 1047

"Unknown command",

#define ER_BAD_NULL_ERROR 1048

"Column '%-.64s' cannot be null",

#define ER_BAD_DB_ERROR 1049

"Unknown database '%-.64s'",

#define ER_TABLE_EXISTS_ERROR 1050

"Table '%-.64s' already exists",

#define ER_BAD_TABLE_ERROR 1051

"Unknown table '%-.64s'",

#define ER_NON_UNIQ_ERROR 1052

"Column: '%-.64s' in %-.64s is ambiguous",

#define ER_SERVER_SHUTDOWN 1053

"Server shutdown in progress",

#define ER_BAD_FIELD_ERROR 1瘀牡?剕????o鸞?054

"Unknown column '%-.64s' in '%-.64s'",

#define ER_WRONG_FIELD_WITH_GROUP 1055

"'%-.64s' isn't in GROUP BY",

#define ER_WRONG_GROUP_FIELD 1056

"Can't group on '%-.64s'",

#define ER_WRONG_SUM_SELECT 1057

"Statement has sum functions and columns in same statement",

#define ER_WRONG_VALUE_COUNT 1058

"Column count doesn't match value count",

#define ER_TOO_LONG_IDENT 1059

"Identifier name '%-.100s' is too long",

#define ER_DUP_FIELDNAME 1060

"Duplicate column name '%-.64s'",

#define ER_DUP_KEYNAME 1061

"Duplicate key name '%-.64s'",

#define ER_DUP_ENTRY 1062

"Duplicate entry '%-.64s' for key %d",

#define ER_WRONG_FIELD_SPEC 1063

"Incorrect column specifier for column '%-.64s'",

#define ER_PARSE_ERROR 1064

"%s near '%-.80s' at line %d",

#define ER_EMPTY_QUERY 1065

"Query was empty",

#define ER_NONUNIQ_TABLE 1066

"Not unique table/alias: '%-.64s'",

#define ER_INVALID_DEFAULT 1067

"Invalid default value for '%-.64s'",

#define ER_MULTIPLE_PRI_KEY 1068

"Multiple primary key defined",

#define ER_TOO_MANY_KEYS 1069

"Too many keys specified; max %d keys allowed",

#define ER_TOO_MANY_KEY_PARTS 1070

"Too many key parts specified. Max %d parts allowed",

#define ER_TOO_LONG_KEY 1071

"Specified key was too long; max key length is %d bytes",

#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072

"Key column '%-.64s' doesn't exist in table",

#define ER_BLOB_USED_AS_KEY 1073

"BLOB column '%-.64s' can't be used in key specification with the used table type", #define ER_TOO_BIG_FIELDLENGTH 1074

"Too big column length for column '%-.64s' (max = %d). Use BLOB instead",

#define ER_WRONG_AUTO_KEY 1075

"Incorrect table definition; There can only be one auto column and it must be defined as a key", #define ER_READY 1076

"%s: ready for connections.

Version: '%s' socket: '%s' port: %d

",

#define ER_NORMAL_SHUTDOWN 1077

"%s: Normal shutdown

",

#define ER_GOT_SIGNAL 1078

"%s: Got signal %d. Aborting!

",

#define ER_SHUTDOWN_COMPLETE 1079

"%s: Shutdown Complete

",

#define ER_FORCING_CLOSE 1080

"%s: 瘀牡?剕????o鸞?Forcing close of thread %ld user: '%-.32s'

",

#define ER_IPSOCK_ERROR 1081

"Can't create IP socket",

#define ER_NO_SUCH_INDEX 1082

"Table '%-.64s' has no index like the one used in CREATE INDEX. Recreate the table",

#define ER_WRONG_FIELD_TERMINATORS 1083

"Field separator argument is not what is expected. Check the manual",

#define ER_BLOBS_AND_NO_TERMINATED 1084

"You can't use fixed rowlength with BLOBs. Please use 'fields terminated by'",

#define ER_TEXTFILE_NOT_READABLE 1085

"The file '%-.64s' must be in the database directory or be readable by all",

#define ER_FILE_EXISTS_ERROR 1086

"File '%-.80s' already exists",

#define ER_LOAD_INFO 1087

"Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld",

#define ER_ALTER_INFO 1088

"Records: %ld Duplicates: %ld",

#define ER_WRONG_SUB_KEY 1089

"Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys",

#define ER_CANT_REMOVE_ALL_FIELDS 1090

"You can't delete all columns with ALTER TABLE. Use DROP TABLE instead",

#define ER_CANT_DROP_FIELD_OR_KEY 1091

"Can't DROP '%-.64s'. Check that column/key exists",

#define ER_INSERT_INFO 1092

"Records: %ld Duplicates: %ld Warnings: %ld",

#define ER_UPDATE_TABLE_USED 1093

"You can't specify target table '%-.64s' for update in FROM clause",

#define ER_NO_SUCH_THREAD 1094

"Unknown thread id: %lu",

#define ER_KILL_DENIED_ERROR 1095

"You are not owner of thread %lu",

#define ER_NO_TABLES_USED 1096

"No tables used",

#define ER_TOO_BIG_SET 1097

"Too many strings for column %-.64s and SET",

#define ER_NO_UNIQUE_LOGFILE 1098

"Can't generate a unique log-filename %-.64s.(1-999)

",

#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099

"Table '%-.64s' was locked with a READ lock and can't be updated",

#define ER_TABLE_NOT_LOCKED 1100

"Table '%-.64s' was not locked with LOCK TABLES",

#define ER_BLOB_CANT_HAVE_DEFAULT 1101

"BLOB/TEXT column '%-.64s' can't have a default value",

#define ER_WRONG_DB_NAME 1102

"Incorre瘀牡?剕????o鸞?ct database name '%-.100s'",

#define ER_WRONG_TABLE_NAME 1103

"Incorrect table name '%-.100s'",

#define ER_TOO_BIG_SELECT 1104

"The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=

# if the SELECT is ok",

#define ER_UNKNOWN_ERROR 1105

"Unknown error",

#define ER_UNKNOWN_PROCEDURE 1106

"Unknown procedure '%-.64s'",

#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107

"Incorrect parameter count to procedure '%-.64s'",

#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108

"Incorrect parameters to procedure '%-.64s'",

#define ER_UNKNOWN_TABLE 1109

"Unknown table '%-.64s' in %-.32s",

#define ER_FIELD_SPECIFIED_TWICE 1110

"Column '%-.64s' specified twice",

#define ER_INVALID_GROUP_FUNC_USE 1111

"Invalid use of group function",

#define ER_UNSUPPORTED_EXTENSION 1112

"Table '%-.64s' uses an extension that doesn't exist in this MySQL version",

#define ER_TABLE_MUST_HAVE_COLUMNS 1113

"A table must have at least 1 column",

#define ER_RECORD_FILE_FULL 1114

"The table '%-.64s' is full",

#define ER_UNKNOWN_CHARACTER_SET 1115

"Unknown character set: '%-.64s'",

#define ER_TOO_MANY_TABLES 1116

"Too many tables. MySQL can only use %d tables in a join",

#define ER_TOO_MANY_FIELDS 1117

"Too many columns",

#define ER_TOO_BIG_ROWSIZE 1118

"Too big row size. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some fields to TEXT or BLOBs",

#define ER_STACK_OVERRUN 1119

"Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=

#' to specify a bigger stack if needed",

#define ER_WRONG_OUTER_JOIN 1120

"Cross dependency found in OUTER JOIN. Examine your ON conditions",

#define ER_NULL_COLUMN_IN_INDEX 1121

"Column '%-.64s' is used with UNIQUE or INDEX but is not defined as NOT NULL",

#define ER_CANT_FIND_UDF 1122

"Can't load function '%-.64s'",

#define ER_CANT_INITIALIZE_UDF 1123

"Can't initialize function '%-.64s'; %-.80s",

#define ER_UDF_NO_PATHS 1124

"No paths allowed for shared瘀牡?剕????o鸞? library",

#define ER_UDF_EXISTS 1125

"Function '%-.64s' already exist",

#define ER_CANT_OPEN_LIBRARY 1126

"Can't open shared library '%-.64s' (errno: %d %-.64s)",

#define ER_CANT_FIND_DL_ENTRY 1127

"Can't find function '%-.64s' in library'",

#define ER_FUNCTION_NOT_DEFINED 1128

"Function '%-.64s' is not defined",

#define ER_HOST_IS_BLOCKED 1129

"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'",

#define ER_HOST_NOT_PRIVILEGED 1130

"Host '%-.64s' is not allowed to connect to this MySQL server",

#define ER_PASSWORD_ANONYMOUS_USER 1131

"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords",

#define ER_PASSWORD_NOT_ALLOWED 1132

"You must have privileges to update tables in the mysql database to be able to change passwords for others",

#define ER_PASSWORD_NO_MATCH 1133

"Can't find any matching row in the user table",

#define ER_UPDATE_INFO 1134

"Rows matched: %ld Changed: %ld Warnings: %ld",

#define ER_CANT_CREATE_THREAD 1135

"Can't create a new thread (errno %d). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug",

#define ER_WRONG_VALUE_COUNT_ON_ROW 1136

"Column count doesn't match value count at row %ld",

#define ER_CANT_REOPEN_TABLE 1137

"Can't reopen table: '%-.64s'",

#define ER_INVALID_USE_OF_NULL 1138

"Invalid use of NULL value",

#define ER_REGEXP_ERROR 1139

"Got error '%-.64s' from regexp",

#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140

"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause",

#define ER_NONEXISTING_GRANT 1141

"There is no such grant defined for user '%-.32s' on host '%-.64s'",

#define ER_TABLEACCESS_DENIED_ERROR 1142

"%-.16s command denied to user: [email=]'%-.32s'@'%-.64s'[/email] for table '%-.64s'",

#define ER_COLUMNACCESS_DENIED_ERROR 1143

"%-.16s command denied to user: [email=]'%-.32s'@'%-.64s'[/email] for column '%-.64s' in table '%-.64s'",

#define ER_ILLEGAL_GRANT_FOR_TABLE 1144

"I瘀牡?剕????o鸞?llegal GRANT/REVOKE command. Please consult the manual which privileges can be used",

#define ER_GRANT_WRONG_HOST_OR_USER 1145

"The host or user argument to GRANT is too long",

#define ER_NO_SUCH_TABLE 1146

"Table '%-.64s.%-.64s' doesn't exist",

#define ER_NONEXISTING_TABLE_GRANT 1147

"There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'",

#define ER_NOT_ALLOWED_COMMAND 1148

"The used command is not allowed with this MySQL version",

#define ER_SYNTAX_ERROR 1149

"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use",

#define ER_DELAYED_CANT_CHANGE_LOCK 1150

"Delayed insert thread couldn't get requested lock for table %-.64s",

#define ER_TOO_MANY_DELAYED_THREADS 1151

"Too many delayed threads in use",

#define ER_ABORTING_CONNECTION 1152

"Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)",

#define ER_NET_PACKET_TOO_LARGE 1153

"Got a packet bigger than 'max_allowed_packet'",

#define ER_NET_READ_ERROR_FROM_PIPE 1154

"Got a read error from the connection pipe",

#define ER_NET_FCNTL_ERROR 1155

"Got an error from fcntl()",

#define ER_NET_PACKETS_OUT_OF_ORDER 1156

"Got packets out of order",

#define ER_NET_UNCOMPRESS_ERROR 1157

"Couldn't uncompress communication packet",

#define ER_NET_READ_ERROR 1158

"Got an error reading communication packets",

#define ER_NET_READ_INTERRUPTED 1159

"Got timeout reading communication packets",

#define ER_NET_ERROR_ON_WRITE 1160

"Got an error writing communication packets",

#define ER_NET_WRITE_INTERRUPTED 1161

"Got timeout writing communication packets",

#define ER_TOO_LONG_STRING 1162

"Result string is longer than max_allowed_packet",

#define ER_TABLE_CANT_HANDLE_BLOB 1163

"The used table type doesn't support BLOB/TEXT columns",

#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164

"The used table type doesn't support AUTO_INCREMENT columns",

#define ER_DELAYED_INSERT_TABLE_LOCKED 1165

"INSERT DELAYED can't be used with table '%-.64s瘀牡?剕????o鸞?' because it is locked with LOCK TABLES",

#define ER_WRONG_COLUMN_NAME 1166

"Incorrect column name '%-.100s'",

#define ER_WRONG_KEY_COLUMN 1167

"The used storage engine can't index column '%-.64s'",

#define ER_WRONG_MRG_TABLE 1168

"All tables in the MERGE table are not identically defined",

#define ER_DUP_UNIQUE 1169

"Can't write, because of unique constraint, to table '%-.64s'",

#define ER_BLOB_KEY_WITHOUT_LENGTH 1170

"BLOB/TEXT column '%-.64s' used in key specification without a key length",

#define ER_PRIMARY_CANT_HAVE_NULL 1171

"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", #define ER_TOO_MANY_ROWS 1172

"Result consisted of more than one row",

#define ER_REQUIRES_PRIMARY_KEY 1173

"This table type requires a primary key",

"This version of MySQL is not compiled with RAID support",

#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175

"You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column",

#define ER_KEY_DOES_NOT_EXITS 1176

"Key '%-.64s' doesn't exist in table '%-.64s'",

#define ER_CHECK_NO_SUCH_TABLE 1177

"Can't open table",

#define ER_CHECK_NOT_IMPLEMENTED 1178

"The storage engine for the table doesn't support %s",

#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179

"You are not allowed to execute this command in a transaction",

#define ER_ERROR_DURING_COMMIT 1180

"Got error %d during COMMIT",

#define ER_ERROR_DURING_ROLLBACK 1181

"Got error %d during ROLLBACK",

#define ER_ERROR_DURING_FLUSH_LOGS 1182

"Got error %d during FLUSH_LOGS",

#define ER_ERROR_DURING_CHECKPOINT 1183

"Got error %d during CHECKPOINT",

#define ER_NEW_ABORTING_CONNECTION 1184

"Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)",

#define ER_DUMP_NOT_IMPLEMENTED 1185

"The storage engine for the table does not support binary table dump",

#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186

"Binlog closed, cannot RESET MASTER",

#define ER_INDEX_REBUILD 1187

"Faile瘀牡?剕????o鸞?d rebuilding the index of dumped table '%-.64s'",

#define ER_MASTER 1188

"Error from master: '%-.64s'",

#define ER_MASTER_NET_READ 1189

"Net error reading from master",

#define ER_MASTER_NET_WRITE 1190

"Net error writing to master",

#define ER_FT_MATCHING_KEY_NOT_FOUND 1191

"Can't find FULLTEXT index matching the column list",

#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192

"Can't execute the given command because you have active locked tables or an active transaction",

#define ER_UNKNOWN_SYSTEM_VARIABLE 1193

"Unknown system variable '%-.64s'",

#define ER_CRASHED_ON_USAGE 1194

"Table '%-.64s' is marked as crashed and should be repaired",

"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",

#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196

"Some non-transactional changed tables couldn't be rolled back",

#define ER_TRANS_CACHE_FULL 1197

"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again",

#define ER_SLAVE_MUST_STOP 1198

"This operation cannot be performed with a running slave, run STOP SLAVE first",

#define ER_SLAVE_NOT_RUNNING 1199

"This operation requires a running slave, configure slave and do START SLAVE",

#define ER_BAD_SLAVE 1200

"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",

#define ER_MASTER_INFO 1201

"Could not initialize master info structure, more error messages can be found in the MySQL error log",

#define ER_SLAVE_THREAD 1202

"Could not create slave thread, check system resources",

#define ER_TOO_MANY_USER_CONNECTIONS 1203

"User %-.64s has already more than 'max_user_connections' active connections",

#define ER_SET_CONSTANTS_ONLY 1204

"You may only use constant expressions with SET",

#define ER_LOCK_WAIT_TIMEOUT 1205

"Lock wait timeout exceeded; Try restarting transaction",

#define ER_LOCK_TABLE_FULL 1206

"The total number of locks exceeds the lock table size",

#define ER_READ_ONLY_TRANSACTION 1207瘀牡?剕????o鸞?

"Update locks cannot be acquired during a READ UNCOMMITTED transaction",

#define ER_DROP_DB_WITH_READ_LOCK 1208

"DROP DATABASE not allowed while thread is holding global read lock",

#define ER_CREATE_DB_WITH_READ_LOCK 1209

"CREATE DATABASE not allowed while thread is holding global read lock",

#define ER_WRONG_ARGUMENTS 1210

"Wrong arguments to %s",

#define ER_NO_PERMISSION_TO_CREATE_USER 1211

"[email=]'%-.32s'@'%-.64s'[/email] is not allowed to create new users",

#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212

"Incorrect table definition; all MERGE tables must be in the same database",

#define ER_LOCK_DEADLOCK 1213

"Deadlock found when trying to get lock; Try restarting transaction",

#define ER_TABLE_CANT_HANDLE_FT 1214

"The used table type doesn't support FULLTEXT indexes",

#define ER_CANNOT_ADD_FOREIGN 1215

"Cannot add foreign key constraint",

#define ER_NO_REFERENCED_ROW 1216

"Cannot add or update a child row: a foreign key constraint fails",

#define ER_ROW_IS_REFERENCED 1217

"Cannot delete or update a parent row: a foreign key constraint fails",

#define ER_CONNECT_TO_MASTER 1218

"Error connecting to master: %-.128s",

#define ER_QUERY_ON_MASTER 1219

"Error running query on master: %-.128s",

#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220

"Error when executing command %s: %-.128s",

#define ER_WRONG_USAGE 1221

"Wrong usage of %s and %s",

#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222

"The used SELECT statements have a different number of columns",

#define ER_CANT_UPDATE_WITH_READLOCK 1223

"Can't execute the query because you have a conflicting read lock",

#define ER_MIXING_NOT_ALLOWED 1224

"Mixing of transactional and non-transactional tables is disabled",

#define ER_DUP_ARGUMENT 1225

"Option '%s' used twice in statement",

#define ER_USER_LIMIT_REACHED 1226

"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",

#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227

"Access denied. You need the %-.128s privilege for this operation",

#define ER_LOCAL_VARIABLE 1228

"Variable '%-.64s' 瘀牡?剕????o鸞?is a SESSION variable and can't be used with SET GLOBAL",

#define ER_GLOBAL_VARIABLE 1229

"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",

#define ER_NO_DEFAULT 1230

"Variable '%-.64s' doesn't have a default value",

#define ER_WRONG_VALUE_FOR_VAR 1231

"Variable '%-.64s' can't be set to the value of '%-.64s'",

#define ER_WRONG_TYPE_FOR_VAR 1232

"Wrong argument type to variable '%-.64s'",

#define ER_VAR_CANT_BE_READ 1233

"Variable '%-.64s' can only be set, not read",

#define ER_CANT_USE_OPTION_HERE 1234

"Wrong usage/placement of '%s'",

#define 1235

"This version of MySQL doesn't yet support '%s'",

#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236

"Got fatal error %d: '%-.128s' from master when reading data from binary log",

#define ER_SLAVE_IGNORED_TABLE 1237

"Slave SQL thread ignored the query because of replicate-*-table rules",

#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238

"Variable '%-.64s' is a %s variable",

#define ER_WRONG_FK_DEF 1239

"Wrong foreign key definition for '%-.64s': %s",

#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240

"Key reference and table reference doesn't match",

#define ER_OPERAND_COLUMNS 1241

"Operand should contain %d column(s)",

#define ER_SUBQUERY_NO_1_ROW 1242

"Subquery returns more than 1 row",

#define ER_UNKNOWN_STMT_HANDLER 1243

"Unknown prepared statement handler (%ld) given to %s",

#define ER_CORRUPT_HELP_DB 1244

"Help database is corrupt or does not exist",

#define ER_CYCLIC_REFERENCE 1245

"Cyclic reference on subqueries",

#define ER_AUTO_CONVERT 1246

"Converting column '%s' from %s to %s",

#define ER_ILLEGAL_REFERENCE 1247

"Reference '%-.64s' not supported (%s)",

#define ER_DERIVED_MUST_HAVE_ALIAS 1248

"Every derived table must have it's own alias",

#define ER_SELECT_REDUCED 1249

"Select %u was reduced during optimisation",

#define ER_TABLENAME_NOT_ALLOWED_HERE 1250

"Table '%-.64s' from one of SELECT's can not be used in %-.32s",

#define ER_NOT_SUPPORTED_AUTH_MODE 1251

"Client does not support authentication pr瘀牡?剕????o鸞?otocol requested by server; consider upgrading MySQL client",

#define ER_SPATIAL_CANT_HAVE_NULL 1252

"All parts of a SPATIAL KEY must be NOT NULL",

#define ER_COLLATION_CHARSET_MISMATCH 1253

"COLLATION '%s' is not valid for CHARACTER SET '%s'",

#define ER_SLAVE_WAS_RUNNING 1254

"Slave is already running",

#define ER_SLAVE_WAS_NOT_RUNNING 1255

"Slave has already been stopped",

#define ER_TOO_BIG_FOR_UNCOMPRESS 1256

"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)",

#define ER_ZLIB_Z_MEM_ERROR 1257

"ZLIB: Not enough memory",

#define ER_ZLIB_Z_BUF_ERROR 1258

"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)",

#define ER_ZLIB_Z_DATA_ERROR 1259

"ZLIB: Input data corrupted",

#define ER_CUT_VALUE_GROUP_CONCAT 1260

"%d line(s) was(were) cut by group_concat()",

#define ER_WARN_TOO_FEW_RECORDS 1261

"Row %ld doesn't contain data for all columns",

#define ER_WARN_TOO_MANY_RECORDS 1262

"Row %ld was truncated; It contained more data than there were input columns",

#define ER_WARN_NULL_TO_NOTNULL 1263

"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",

#define ER_WARN_DATA_OUT_OF_RANGE 1264

"Data truncated, out of range for column '%s' at row %ld",

#define ER_WARN_DATA_TRUNCATED 1265

"Data truncated for column '%s' at row %ld",

#define ER_WARN_USING_OTHER_HANDLER 1266

"Using storage engine %s for table '%s'",

#define ER_CANT_AGGREGATE_2COLLATIONS 1267

"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'",

#define ER_DROP_USER 1268

"Can't drop one or more of the requested users",

#define ER_REVOKE_GRANTS 1269

"Can't revoke all privileges, grant for one or more of the requested users",

#define ER_CANT_AGGREGATE_3COLLATIONS 1270

"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",

#define ER_CANT_AGGREGATE_NCOLLATIONS 1271

"Illegal mix of collations for operation '%s'",

#define ER_VARIABLE_IS_NOT_STRUCT 1272

"Variable '%-.64s' is瘀牡?剕????o鸞?not a variable component (Can't be used as XXXX.variable_name)",

#define ER_UNKNOWN_COLLATION 1273

"Unknown collation: '%-.64s'",

#define ER_SLAVE_IGNORED_SSL_PARAMS 1274

"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started",

#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275

"Server is running in --secure-auth mode, but [email=]'%s'@'%s'[/email] has a password in the old format; please change the password to the new format",

#define ER_WARN_FIELD_RESOLVED 1276

"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT

#%d was resolved in SELECT

#%d",

#define ER_BAD_SLAVE_UNTIL_COND 1277

"Wrong parameter or combination of parameters for START SLAVE UNTIL",

#define ER_MISSING_SKIP_SLAVE 1278

"It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL. Otherwise you will get problems if you get an unexpected slave's mysqld restart", #define ER_UNTIL_COND_IGNORED 1279

"SQL thread is not to be started so UNTIL options are ignored",

#define ER_WRONG_NAME_FOR_INDEX 1280

"Incorrect index name '%-.100s'",

#define ER_WRONG_NAME_FOR_CATALOG 1281

"Incorrect catalog name '%-.100s'",

#define ER_WARN_QC_RESIZE 1282

"Query cache failed to set size %lu, new query cache size is %lu",

#define ER_BAD_FT_COLUMN 1283

"Column '%-.64s' cannot be part of FULLTEXT index",

#define ER_UNKNOWN_KEY_CACHE 1284

"Unknown key cache '%-.100s'",

#define ER_WARN_HOSTNAME_WONT_WORK 1285

"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",

#define ER_UNKNOWN_STORAGE_ENGINE 1286

"Unknown table engine '%s'",

#define ER_WARN_DEPRECATED_SYNTAX 1287

"'%s' is deprecated, use '%s' instead",

#define ER_NON_UPDATABLE_TABLE 1288

"The target table %-.100s of the %s is not updatable",

#define ER_FEATURE_DISABLED 1289

"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",

#define ER_OPTION_PREVENTS_STATEME瘀牡?剕????o鸞?NT 1290

"The MySQL server is running with the %s option so it cannot execute this statement",

#define ER_DUPLICATED_VALUE_IN_TYPE 1291

"Column '%-.100s' has duplicated value '%-.64s' in %s"

#define ER_TRUNCATED_WRONG_VALUE 1292

"Truncated wrong %-.32s value: '%-.128s'"

#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293

"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"

#define ER_INVALID_ON_UPDATE 1294

"Invalid ON UPDATE clause for '%-.64s' field",

#define ER_UNSUPPORTED_PS 1295

"This command is not supported in the prepared statement protocol yet",

MySQL 数据库常用命令 简单超级实用版

MySQL 数据库常用命令简单超级实用版 1、MySQL常用命令 create database name; 创建数据库 use databasename; 选择数据库 drop database name 直接删除数据库,不提醒 show tables; 显示表 describe tablename; 表的详细描述 select 中加上distinct去除重复字段 mysqladmin drop databasename 删除数据库前,有提示。 显示当前mysql版本和当前日期 select version(),current_date; 2、修改mysql中root的密码: shell>mysql -u root -p mysql> update user set password=password(”xueok654123″) where user='root'; mysql> flush privileges //刷新数据库 mysql>use dbname;打开数据库: mysql>show databases; 显示所有数据库 mysql>show tables; 显示数据库mysql中所有的表:先use mysql;然后 mysql>describe user; 显示表mysql数据库中user表的列信息); 3、grant 创建一个可以从任何地方连接服务器的一个完全的超级用户,但是必须使用一个口令some thing做这个 mysql> grant all privileges on *.* to user@localhost identified by 'something' with 增加新用户

mysql乱码处理

用MS SQL和oracle9 太吃内存,有点大,全给卸载了. 安装了mysql占内存小,方便使用! version:mysql-essential-5.1.36 在MySQL Command Line Client显示中文一切正常; 在eclipse中新工程,连接到mysql,读取一个表显示: 代码: package com.mch.mysql; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Mysql1 { public static void main(String[] args) { String url ="jdbc:mysql://localhost/test"; String user="root"; String password="******"; try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); Connection conn= DriverManager.getConnection(url,user,password); Statement stmt = conn.createStatement();

ResultSet rs = stmt.executeQuery("select * from pet"); while(rs.next()){ System.out.print("name:" + rs.getString(1)); System.out.print("\t所有者:" + rs.getString(2)); System.out.print("\tbirth:" + rs.getString("birth")); System.out.println(); } rs.close(); stmt.close(); conn.close(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } } 显示乱码?号.

C语言错误代码及错误信息 错误释义

C语言错误代码及错误信息错误释义 error 1: Out of memory 内存溢出 error 2: Identifier expected 缺标识符 error 3: Unknown identifier 未定义的标识符 error 4: Duplicate identifier 重复定义的标识符 error 5: Syntax error 语法错误 error 6: Error in real constant 实型常量错误 error 7: Error in integer constant 整型常量错误 error 8: String constant exceeds line 字符串常量超过一行 error 10: Unexpected end of file 文件非正常结束 error 11: Line too long 行太长 error 12: Type identifier expected 未定义的类型标识符 error 13: Too many open files 打开文件太多 error 14: Invalid file name 无效的文件名 error 15: File not found 文件未找到 error 16: Disk full 磁盘满 error 17: Invalid compiler directive 无效的编译命令 error 18: Too many files 文件太多 error 19: Undefined type in pointer def 指针定义中未定义类型 error 20: V ariable identifier expected 缺变量标识符 error 21: Error in type 类型错误 error 22: Structure too large 结构类型太长 error 23: Set base type out of range 集合基类型越界 error 24: File components may not be files or objectsfile分量不能是文件或对象error 25: Invalid string length 无效的字符串长度 error 26: Type mismatch 类型不匹配 error 27:error 27:Invalid subrange base type 无效的子界基类型 error 28:Lower bound greater than upper bound 下界超过上界 error 29:Ordinal type expected 缺有序类型 error 30:Integer constant expected 缺整型常量 error 31:Constant expected 缺常量

mysql命令大全

Mysql命令大全(完整版) 一、连接数据库 格式:mysql -h主机地址-u用户名-p用户密码 1.1.连接到本机上的MYSQL。 首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root -p,回车后提示你输密码. 注意用户名前可以有空格也可以没有空格,但是密码前必须没有空格,否则让你重新输入密码。 如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是:mysql> 1.2连接到远程主机上的MYSQL。 假设远程主机的IP为:110.110.110.110,用户名为root,密码为abcd123。则键入以下命令: mysql -h110.110.110.110 -u root -p 123;(注:u与root之间可以不用加空格,其它也一样) 1.3退出MYSQL命令: exit (回车) 二、增加用户 格式:grant select on 数据库.* to 用户名@登录主机identified by “密码” 2.1 增加一个用户test1密码为abc,让他可以在任何主机上登录,并对所有数据库有查询、插入、修改、删除的权限。 首先用root用户连入MYSQL,然后键入以下命令: 复制代码代码如下: grant select,insert,update,delete on *.* to [email=test1@”%]test1@”%[/email]” Identified by “abc”; 但增加的用户是十分危险的,你想如某个人知道test1的密码,那么他就可以在internet 上的任何一台电脑上登录你的mysql数据库并对你的数据可以为所欲为了,解决办法见2.2。 2.2增加一个用户test2密码为abc,让他只可以在localhost上登录,并可以对数据库mydb进行查询、插入、修改、删除的操作(localhost指本地主机,即MYSQL数据库所在的那台主机),这样用户即使用知道test2的密码,他也无法从internet上直接访问数据库,只能通过MYSQL主机上的web页来访问。 复制代码代码如下: grant select,insert,update,delete on mydb.* to [email=test2@localhost]test2@localhost[/email] identi fied by “abc”; 如果你不想test2有密码,可以再打一个命令将密码消掉。 复制代码代码如下: grant select,insert,update,delete on mydb.* to [email=test2@localhost]test2@localhost[/email] identified by “” 三、操作数据库 3.1创建数据库 注意:创建数据库之前要先连接Mysql服务器 命令:create database <数据库名>

数据库原理及应用教程第4版习题参考答案

习题参考答案 第1章习题参考答案 一、选择题 1. C 2. B 3. D 4. C 5. D 6. B 7. A 8. B 9. D 10. B 11. C 12. D 13. D 14. D 15. B 16. C 17. D 18. A 19. D 20. A 21. D 22. D 23. C 24. A 25. C 二、填空题 1. 数据库系统阶段 2. 关系 3. 物理独立性 4. 操作系统 5. 数据库管理系统(DBMS) 6. 一对多 7. 独立性 8. 完整性控制 9. 逻辑独立性 10. 关系模型 11. 概念结构(逻辑) 12. 树有向图二维表嵌套和递归 13. 宿主语言(或主语言) 14. 数据字典 15. 单用户结构主从式结构分布式结构客户/服务器结构浏览器/服务器结构 16. 现实世界信息世界计算机世界 三、简答题 1、简述数据库管理技术发展的三个阶段。各阶段的特点是什么? 答:数据库管理技术经历了人工管理阶段、文件系统阶段和数据库系统阶段。 (1)、人工管理数据的特点: A、数据不保存。 B、系统没有专用的软件对数据进行管理。 C、数据不共

享。D、数据不具有独立性。 (2)、文件系统阶段的特点: A、数据以文件的形式长期保存。 B、由文件系统管理数据。 C、程序与数据之间有一定的独立性。 D、文件的形式已经多样化 E、数据具有一定的共享性 (3)、数据库系统管理阶段特点: A、数据结构化。 B、数据共享性高、冗余度底。 C、数据独立性高。 D、有统一的数据控制功能。 2、从程序和数据之间的关系来分析文件系统和数据库系统之间的区别和联系 答:数据管理的规模日趋增大,数据量急剧增加,文件管理系统已不能适应要求,数据库管理技术为用户提供了更广泛的数据共享和更高的数据独立性,进一步减少了数据的余度,并为用户提供了方便的操作使用接口。数据库系统对数据的管理方式与文件管理系统不同,它把所有应用程序中使用的数据汇集起来,以记录为单位存储,在数据库管理系统的监督和管理下使用,因此数据库中的数据是集成的,每个用户享用其中的一部分。 3、简述数据库、数据库管理系统、数据库系统三个概念的含义和联系。答:数据库是指存储在计算机内、有组织的、可共享的数据集合。 数据库管理系统是软件系统的一个重要组成部分,它通过借助操作系统完成对硬件的访问,并对数据库的数据进行存取、维护和管理。 数据库系统是指计算机系统中引入数据库后的系统构成。它主要由数据库、数据库用户、计算机硬件系统和计算机软件系统几部分组成。 三者的联系是:数据库系统包括数据库和数据库管理系统。数据库系统主要通过数据库管理系统对数据库进行管理的。 4、数据库系统包括哪几个主要组成部分?各部分的功能是什么?画出整个数据库系统的层次结构图。 答:数据库系统包括:数据库、数据库用户、软件系统和硬件系统。 数据库主要是来保存数据的。 数据库用户是对数据库进行使用的人,主要对数据库进行存储、维护和检索等操作。 软件系统主要完成对数据库的资源管理、完成各种操作请求。 硬件系统主要完成数据库的一些物理上的操作,如物理存储、输入输出等。

个人总结的mysql常用命令大全

第一招、mysql服务的启动和停止 net stop mysql net start mysql 第二招、登陆mysql 语法如下:mysql -u用户名-p用户密码 键入命令mysql -uroot -p,回车后提示你输入密码,输入12345,然后回车即可进入到mysql中了,mysql 的提示符是: mysql> 注意,如果是连接到另外的机器上,则需要加入一个参数-h机器IP 第三招、增加新用户 格式:grant 权限on 数据库.* to 用户名@登录主机identified by "密码" 如,增加一个用户user1密码为password1,让其可以在本机上登录,并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入mysql,然后键入以下命令: grant select,insert,update,delete on *.* to user1@localhost Identified by "password1"; 如果希望该用户能够在任何机器上登陆mysql,则将localhost改为"%"。 如果你不想user1有密码,可以再打一个命令将密码去掉。 grant select,insert,update,delete on mydb.* to user1@localhost identified by ""; 第四招:操作数据库 登录到mysql中,然后在mysql的提示符下运行下列命令,每个命令以分号结束。 1、显示数据库列表。 show databases; 缺省有两个数据库:mysql和test。mysql库存放着mysql的系统和用户权限信息,我们改密码和新增用户,实际上就是对这个库进行操作。 2、显示库中的数据表: use mysql;

mysql源代码分析

Mysql源代码分析系列(2): 源代码结构 Mysql源代码主要包括客户端程序代码,服务器端代码,测试工具和一些库构成,下面我们对比较重要的目录做些介绍。 BUILD 这个目录在本系列的上篇文章中我们仔细看过,内含各种平台的编译脚本,这里就不仔细说了。 client 这个目录下有如下比较让人眼熟的文件: , , , ,等等,如果你编译一下就会发现那些眼熟的程序也出现了,比如mysql。明白了吧,这个目录就是那些客户端程序所在的目录。这个目录的内容也比较少,而且也不是我们阅读的重点。 Docs 这个目录包含了文档。 storage 这个目录包含了所谓的Mysql存储引擎(storage engine)。存储引擎是数据库系统的核心,封装了数据库文件的操作,是数据库系统是否强大最重要的因素。Mysql实现了一个抽象接口层,叫做handler(sql/,其中定义了接口函数,比如:ha_open, ha_index_end, ha_create等等,存储引擎需要实现这些接口才能被系统使用。这个接口定义超级复杂,有900多行:-(,不过我们暂时知道它是干什么的就好了,没必要深究每行代码。对于具体每种引擎的特点,我推荐大家去看mysql的在线文档:

应该能看到如下的目录: * innobase, innodb的目录,当前最流行的存储引擎 * myisam, 最早的Mysql存储引擎,一直到innodb出现以前,使用最广的引擎。 * heap, 基于内存的存储引擎 * federated, 一个比较新的存储引擎 * example, csv,这几个大家可以作为自己写存储引擎时的参考实现,比较容易读懂 mysys 包含了对于系统调用的封装,用以方便实现跨平台。大家看看文件名就大概知道是什么情况了。 sql 这个目录是另外一个大块头,你应该会看到,没错,这里就是数据库主程序mysqld所在的地方。大部分的系统流程都发生在这里。你还能看到, , ,等等,分别实现了对应的SQL命令。后面我们还要经常提到这个目录下的文件。 大概有如下及部分: SQL解析器代码: , , , 等,实现了对SQL语句的解析操作。

MySql 命令

Mysql show databases; create database name; use databasename; drop database name show tables; describe tablename; select distinct mysqladmin drop databasename mysql select version(),current_date; mysql root shell>mysql -h localhost -u root -p // mysql> update user set password=password("xueok654123") where user='root'; mysql> flush privileges // mysql>use dbname; mysql>show databases; mysql>show tables; mysql use mysql; mysql>describe user; mysql user); grant firstdb(firstdb)firstdb mysql> create database firstdb; mysql> grant all on firstdb.* to firstdb identified by 'firstdb' firstdb mysql localhost,IP127.0.0.1IP IP grant mysql>grant all on *.* to root@202.116.39.2 identified by "123456"; :grant on :insert,select,update on ,** root@IP identified by drop database firstdb; something mysql> grant all privileges on *.* to user@localhost identified by 'something' with grant select on .* to @identified by "" GRANT ALL PRIVILEGES ON *.* TO monty@"%" IDENTIFIED BY 'something' WITH GRANT OPTION; mysql> revoke all privileges on *.* from root@"%"; mysql> delete from user where user="root" and host="%"; mysql> flush privileges; custom https://www.sodocs.net/doc/c67105476.html, fangchandb mysql >grant select, insert, update, delete, create,drop on fangchandb.* to custom@ https://www.sodocs.net/doc/c67105476.html, identified by ' passwd' : mysqldump shell> mysqldump -h host -u root -p dbname >dbname_backup.sql shell> mysqladmin -h myhost -u root -p create dbname shell> mysqldump -h host -u root -p dbname < dbname_backup.sql shell> mysqladmin -u root -p -d databasename > a.sql sql shell> mysqladmin -u root -p -t databasename > a.sql sql? mysqldump -T./ phptest driver -T./mysqldump driver.sql. txt sql mysql my_file.sql sql.txt mysql > mysql -h myhost -u root -p Mysql5.0 MySQL?(ORACLE) sysuser Create TABLE `firstdb`.`users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(40) default NULL, `birthday` date default NULL,

数据库应用作业参考答案

读书破万卷下笔如有神 数据库应用作业参考答案 1.第1题 将多个查询结果返回一个结果集合的运算符是( )。 A.JOIN B.UNION C.INTO D.LIKE 您的答案:B 题目分数:3 此题得分:3.0 2.第2题 SELECT s_no=学号,s_name=姓名FROM information WHERE 班级名='软件021'表示( )。 A.查询INFORMATION表中'软件021'班学生的学号、姓名 B.查询INFORMATION表中'软件021'班学生的所有信息 C.查询INFORMATION表中学生的学号、姓名 D.查询INFORMATION表中计算机系学生的记录 您的答案:A 题目分数:3 此题得分:3.0 3.第3题 表达式STUFF(‘HOW ARE YOU',4,1,'OLD')的值是()。 A.'HOWARE YOU' B.'HOW OLD ARE YOU' C.'HOWOLDARE YOU' D.'HOW OLD RE YOU' 您的答案:B 题目分数:3 此题得分:3.0 4.第4题 命令SELECT s_no,A VG(grade) AS ‘平均成绩' FROM score GROUP BY s_no HA VING A VG(grade)>=85,表示( )。 A.查找score表中平均成绩在85分以上的学生的学号和平均成绩 B.查找平均成绩在85分以上的学生 C.查找score表中各科成绩在85分以上的学生

D.查找score表中各科成绩在85分以上的学生的学号和平均成绩 读书破万卷下笔如有神 您的答案:A 题目分数:3 此题得分:3.0 5.第5题 ( )是位于用户与操作系统之间的一层数据管理软件。 A.数据库管理系统 B.数据库系统 C.数据库 D.数据库应用系统 您的答案:A 题目分数:3 此题得分:3.0 6.第6题 将SQL Server 2000的数据库转换成ACCESS数据库,可以使用( )来实现。 A.订阅/发布 B.数据备份/恢复 C.数据分离/附加 D.DTS导入/导出 您的答案:D 题目分数:3 此题得分:3.0 7.第7题 索引项的顺序与表中记录的物理顺序一致的索引,称之为( )。 A.复合索引 B.唯一性索引 C.聚簇索引 D.非聚簇索引 您的答案:B 题目分数:3 此题得分:3.0 8.第8题 下列命令不属于DBMS的数据定义语言的是:( )。 A.CREATE B.DROP

MYSQL 常用命令

1.导出整个数据库 mysqldump -u 用户名 -p --default-character-set=latin1 数据库名 > 导出的文件名(数据库默认编码是latin1) mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql 2.导出一个表 mysqldump -u 用户名 -p 数据库名表名> 导出的文件名 mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql 3.导出一个数据库结构 mysqldump -u wcnc -p -d –add-drop-table smgp_apps_wcnc >d:wcnc_db.sql -d 没有数据–add-drop-table 在每个create语句之前增加一个drop table 4.导入数据库 A:常用source 命令 进入mysql数据库控制台, 如mysql -u root -p mysql>use 数据库 然后使用source命令,后面参数为脚本文件(如这里用到的.sql) mysql>source wcnc_db.sql B:使用mysqldump命令 mysqldump -u username -p dbname < filename.sql C:使用mysql命令 mysql -u username -p -D dbname < filename.sql 一、启动与退出 1、进入MySQL:启动MySQL Command Line Client(MySQL的DOS界面),直接输入安装时的密码即可。此时的提示符是:mysql> 2、退出MySQL:quit或exit 二、库操作 1、、创建数据库 命令:create database <数据库名> 例如:建立一个名为xhkdb的数据库 mysql> create database xhkdb;

2019年MYSQL安装常见错误

MySql 安装时的1045错误 MySql 安装到最后一步遇到1045错误Access denied for user 'root'@'localhost' (using password:YES) 解决方案一:卸载MySQL,重新安装 1, 卸载MySQL 2, 删除目录C:\Documents and Settings\All Users\Application Data\MySQL,还要删除MySQL安装目录 3, 重新安装MySQL 就好了 如何你C:\Documents and Settings\All Users下没有Application Data文件夹,选择:工具——文件夹选项——查看——选择显示所有文件和文件夹 这样的就行,不过,上面的设置都是默认安装时,数据库文件所在的问题,如果你是自定义安装的话,要根据自己的实际情况来删除上面的提到文件。 解决方案二:重新设置root用户密码 在Windows平台下操作步骤如下: 1、以系统管理员身份登录到系统; 2、如果MySQL服务器正在运行,停止它。 如果是作为Windows服务运行的服务器,进入服务管理器:开始菜单->控制面板->管理工具->服务 如果服务器不是作为服务而运行的,可能需要使用任务管理器来强制停止它。 3、创建1个文本文件,并将下述命令置于单一行中: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword'); 用任意名称保存该文件。在本例中,该文件为C:\。 4、进入DOS命令提示:开始菜单->运行-> cmd 假定你已将MySQL安装到C:\mysql。如果你将MySQL安装到了另一位置,请对下述命令进行相应的调整。 在DOS命令提示符下,执行命令: C:\mysql\bin\>mysqld-nt --init-file=C:\ 在服务器启动时,执行由“--init-file”选项(作用:在启动时从指定的文件中读取SQL命令)命名的文件的内容,更改根用户密码。当服务器成功启动后,应删除C:\。 5、如果起动MySQL服务器出错,把进程关闭。然后重启它,OK。 6、或者停止MySQL服务器,然后在正常模式下重启它。如果以服务方式运行服务器,应从Windows服务窗口启动它。如果以手动方式启动了服务器,能够像正常情形下一样使用命令。

数据库考题及答案参考

一、填空和选择 1.数据库管理产生和发展的三个阶段Page: 6 人工管理阶段、文件系统阶段、数据库系统阶段 2.视图的概念page 118 视图是从一个或几个基本表(虚表),视图一经定义,就可以和基本表一样被查询,被删除,也可以在一个视图之上在定义新的视图,但对视图的更新操作则有一定的限制 3.关系模型的三类完整性约束page 30 实体完整性、参照完整性、和用户定义性的完整性 4.关系运算运算中的两种特殊符号%百分号,_ 下划线page 96 5.四类数据逻辑模型page 18 逻辑模型主要包括:层次模型/网状模型(格式化模型)、关系模型、面向对象模型、对象关系模型 6.关系模型的三个组成部分page 338 数据结构、关系操作、数据完整性 7.数据字典包含的五个组成部分page 207 数据项、数据结构、数据流、数据存储、处理过程5个部分;其中数据项是数据的最小组成单位,若干数据项可以组成一个数据结构,数据字典通过对数据项和数据结构的定义来描述数据流,数据存储的逻辑内容 8.两种数据操作类型page 12 概念模型一信息模型;(按用户的观点来对数据和信息建模,用于数据库设计) 逻辑模型(按计算机系统的观点对数据建模,主要用于DBMS的实现) 9.数据库系统和文化系统的区别page 7~9 数据库系统实现整体数据的结构化,这事数据库的主要特征之一,也是数据库系统与文件系统的本质区别 Page6的表也可以参照! 10.数据库设计过程的六个阶段(注意ER图转换)page 201 需求分析、概念结构设计、逻辑结构设计、物理结构设计、数据库实施、数据库运行和维护 11.关系模型的几个概念page 28 关系模型是目前最重要的一种数据模型。关系数据库系统采用关系模型作为数据组织方式 关系:relation 一个关系对应通常说的一张表 元组tuple: 表中的一行,即一个元组

MYSQL数据库命令大全

MYSQL命令大全 常见的MySQL命令大全 一、连接MySQL 格式:mysql -h主机地址-u用户名-p用户密码 1、例1:连接到本机上的MYSQL。 首先在打开DOS窗口,然后进入目录mysqlbin,再键入命令mysql -uroot -p,回车后提示你输密码,如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是:mysql>。 2、例2:连接到远程主机上的MYSQL。假设远程主机的IP为:110.110.110.110,用户名为root,密码为abcd123。则键入以下命令: mysql -h110.110.110.110 -uroot -pabcd123 (注:u与root可以不用加空格,其它也一样) 3、退出MYSQL命令:exit (回车)。 二、修改密码 格式:mysqladmin -u用户名-p旧密码password 新密码 1、例1:给root加个密码ab12。首先在DOS下进入目录mysqlbin,然后键入以下命令: mysqladmin -uroot -password ab12 注:因为开始时root没有密码,所以-p旧密码一项就可以省略了。 2、例2:再将root的密码改为djg345。 mysqladmin -uroot -pab12 password djg345 三、增加新用户。(注意:和上面不同,下面的因为是MySQL环境中的命令,所以后面都带一个分号作为命令结束符) 格式:grant select on 数据库.* to 用户名@登录主机identified by \"密码\" 例1、增加一个用户test1密码为abc,让他可以在任何主机上登录,

MySQL错误代码以及出错信息对照大全

0101 属于其他进程的专用标志。 0102 标志已经设置,无法关闭。 0103 无法再次设置该标志。 0104 中断时无法请求专用标志。 0105 此标志先前的所有权已终止。 0106 请将软盘插入驱动器 %1。 0107 后续软盘尚未插入,程序停止。 0108 磁盘正在使用或已由其他进程锁定。0109 管道已经结束。 0110 系统无法打开指定的设备或文件。 0111 文件名太长。 0112 磁盘空间不足。 0113 没有其他可用的内部文件标识符。 0114 目标内部文件标识符不正确。 0117 该应用程序所运行的 IOCTL 调用不正确。0118 校验写入的开关参数值不正确。 0119 系统不支持所请求的命令。 0120 该系统上不支持此功能。 0121 标记已超时。 0123 文件名、目录名或卷标语法错误。 0124 系统调用层不正确。 0125 磁盘没有卷标。

0126 找不到指定的模块。 0127 找不到指定的过程。 0128 没有要等候的子进程。 0129 模式下运行。 0130 试图使用操作(而非原始磁盘I/O)的已打开磁盘分区的文件句柄。0131 试图将文件指针移至文件开头之前。 0132 无法在指定的设备或文件中设置文件指针。 0133 对于包含已连接驱动器的驱动器,不能使用 JOIN 或 SUBST 命令。0134 试图在已经连接的驱动器上使用 JOIN 或 SUBST 命令。 0135 试图在已经替换的驱动器上使用 JOIN 或 SUBST 命令。 0136 系统试图删除尚未连接的驱动器的 JOIN。 0137 系统试图删除尚未替换的驱动器的替换项。 0138 系统试图将驱动器连接到已连接的驱动器下的目录。 0139 系统试图将驱动器替换成已替换的驱动器下的目录。 0140 系统试图将驱动器连接到已替换的驱动器的一个目录中。 0141 系统试图将驱动器替换成到已连接的驱动器下的目录。 0142 此时系统无法运行 JOIN 或 SUBST。 0143 系统无法将驱动器连接到或替换成同一驱动器下的目录。 0144 此目录不是该根目录的子目录。 0145 该目录未清空。 0146 指定的路径已经在替换中使用。

数据库原理及应用(第2版)习题参考答案..

第1章数据概述 一.选择题 1.下列关于数据库管理系统的说法,错误的是C A.数据库管理系统与操作系统有关,操作系统的类型决定了能够运行的数据库管理系统的类型 B.数据库管理系统对数据库文件的访问必须经过操作系统实现才能实现 C.数据库应用程序可以不经过数据库管理系统而直接读取数据库文件 D.数据库管理系统对用户隐藏了数据库文件的存放位置和文件名 2.下列关于用文件管理数据的说法,错误的是D A.用文件管理数据,难以提供应用程序对数据的独立性 B.当存储数据的文件名发生变化时,必须修改访问数据文件的应用程序 C.用文件存储数据的方式难以实现数据访问的安全控制 D.将相关的数据存储在一个文件中,有利于用户对数据进行分类,因此也可以加快用户操作数据的效率 3.下列说法中,不属于数据库管理系统特征的是C A.提供了应用程序和数据的独立性 B.所有的数据作为一个整体考虑,因此是相互关联的数据的集合 C.用户访问数据时,需要知道存储数据的文件的物理信息 D.能够保证数据库数据的可靠性,即使在存储数据的硬盘出现故障时,也能防止数据丢失 5.在数据库系统中,数据库管理系统和操作系统之间的关系是D A.相互调用 B.数据库管理系统调用操作系统 C.操作系统调用数据库管理系统 D.并发运行 6.数据库系统的物理独立性是指D A.不会因为数据的变化而影响应用程序 B.不会因为数据存储结构的变化而影响应用程序 C.不会因为数据存储策略的变化而影响数据的存储结构 D.不会因为数据逻辑结构的变化而影响应用程序 7.数据库管理系统是数据库系统的核心,它负责有效地组织、存储和管理数据,它位于用户和操作系统之间,属于A A.系统软件B.工具软件 C.应用软件D.数据软件 8.数据库系统是由若干部分组成的。下列不属于数据库系统组成部分的是B A.数据库B.操作系统 C.应用程序D.数据库管理系统 9.下列关于客户/服务器结构和文件服务器结构的描述,错误的是D A.客户/服务器结构将数据库存储在服务器端,文件服务器结构将数据存储在客户端 B.客户/服务器结构返回给客户端的是处理后的结果数据,文件服务器结构返回给客户端的是包含客户所需数据的文件 C.客户/服务器结构比文件服务器结构的网络开销小 D.客户/服务器结构可以提供数据共享功能,而用文件服务器结构存储的数据不能共享

mysql命令语句大全

show databases; 显示数据库 create database name; 创建数据库 use databasename; 选择数据库 drop database name 直接删除数据库,不提醒 show tables; 显示表 describe tablename; 显示具体的表结构 select 中加上distinct去除重复字段 mysqladmin drop databasename 删除数据库前,有提示。 显示当前mysql版本和当前日期 select version(),current_date; 修改mysql中root的密码: shell>mysql -h localhost -u root -p //登录 mysql> update user set password=password("xueok654123") where user='root'; mysql> flush privileges //刷新数据库 mysql>use dbname; 打开数据库: mysql>show databases; 显示所有数据库 mysql>show tables; 显示数据库mysql中所有的表:先use mysql;然后 mysql>describe user; 显示表mysql数据库中user表的列信息); grant 创建用户firstdb(密码firstdb)和数据库,并赋予权限于firstdb数据库 mysql> create database firstdb; mysql> grant all on firstdb.* to firstdb identified by 'firstdb' 会自动创建用户firstdb mysql默认的是本地主机是localhost,对应的IP地址就是127.0.0.1,所以你用你的IP 地址登录会出错,如果你想用你的IP地址登录就要先进行授权用grant命令。 mysql>grant all on *.* to root@202.116.39.2 identified by "123456"; 说明:grant 与on 之间是各种权限,例如:insert,select,update等 on 之后是数据库名和表名,第一个*表示所有的数据库,第二个*表示所有的表 root可以改成你的用户名,@后可以跟域名或IP地址,identified by 后面的是登录用的密码,可以省略,即缺省密码或者叫空密码。 drop database firstdb; 创建一个可以从任何地方连接服务器的一个完全的超级用户,但是必须使用一个口令something做这个 mysql> grant all privileges on *.* to user@localhost identified by 'something' with 增加新用户 格式:grant select on 数据库.* to 用户名@登录主机identified by "密码"

mysql数据库常用语句大全

mysql数据库常用语句 SQL分类: DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE) DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT) DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK) 首先,简要介绍基础语句: 1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份sql server --- 创建备份数据的device USE master EXEC sp_addumpdevice ’disk’, ’testBack’, ’c:mssql7backupMyNwind_1.dat’ --- 开始备份 BACKUP DATABASE pubs TO testBack 4、说明:创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..) 根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明: 删除新表:drop table tabname 6、说明: 增加一个列:Alter table tabname add column col type 注:列增加后将不能删除。DB2中列加上后数据类型也不能改变,唯一能改变的是增加varchar 类型的长度。 7、说明: 添加主键:Alter table tabname add primary key(col) 说明: 删除主键:Alter table tabname drop primary key(col) 8、说明: 创建索引:create [unique] index idxname on tabname(col….) 删除索引:drop index idxname 注:索引是不可更改的,想更改必须删除重新建。 9、说明: 创建视图:create view viewname as select statement 删除视图:drop view viewname 10、说明:几个简单的基本的sql语句 选择:select * from table1 where 范围 插入:insert into table1(field1,field2) values(value1,value2) 删除:delete from table1 where 范围 更新:update table1 set field1=value1 where 范围

相关主题