简体   繁体   English

表不存在MySQL

[英]Table doesn't exist MySQL

In regards to this guide for compiling Arcemu : 关于本Arcemu编译指南

I have followed all steps and everything is fine until I reach the steps: 我遵循了所有步骤,一切都很好,直到达到步骤为止:

At the command line, enter the following commands; 在命令行中,输入以下命令;

 create database arc_logon; create database arc_characters; create database arc_world; 

This isn't the exact spot but shortly after the guide asks me to: 这不是确切的位置,但是在向导要求我之后不久:

mysql -u root -p arc_logon
INSERT INTO `accounts` (login, password, gm, flags, banned) VALUES ('your-login-name', 'your-password', 'az', '24', '0'); 

This is right after the following step: 紧接着执行以下步骤:

 ubuntu@ubuntu:/home/arcemu/src/code/sql$ ls -l total 480 -rw-r--r-- 1 arcemu arcemu 2146 2011-05-12 22:03 2834_logon_structure.sql -rw-r--r-- 1 arcemu arcemu 36315 2011-05-12 22:03 3800_character_structure.sql -rw-r--r-- 1 arcemu arcemu 421549 2011-05-12 22:03 3955_world_structure.sql drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 character_updates drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 extra_scripts drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 logon_updates drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 misc drwxr-xr-x 4 arcemu arcemu 4096 2011-05-12 22:03 utilities drwxr-xr-x 3 arcemu arcemu 4096 2011-05-12 22:03 world_updates 

After executing the INSERT INTO line of code I receive the error: 在执行INSERT INTO代码行后,我收到错误消息:

Error 1146 (42502): Table 'arc_logon.accounts' doesn't exist

Why is there no accounts table populated when I created the database? 为什么在创建数据库时没有填充帐户表? Do I have to set it up? 我需要设置吗?

Open nautilus (file explorer) and navigate to: 打开nautilus(文件浏览器)并导航至:

/home/arcemu/src/code/sql

Make sure all these files exist there: logon_structure.sql , character_structure.sql , world_structure.sql 确保所有这些文件都存在: logon_structure.sqlcharacter_structure.sqlworld_structure.sql

Now, in your terminal, do: 现在,在您的终端中,执行以下操作:

cd /home/arcemu/src/code/sql

Then, import each of the above files, do: 然后,导入上述每个文件,执行以下操作:

mysql -u root -p arc_logon < logon_structure.sql

mysql -u root -p arc_character < character_structure.sql

mysql -u root -p arc_world < world_structure.sql

You will be asked to enter the mysql password after each one. 每次输入后,将要求您输入mysql密码。

Try to do this 尝试做这个

first open a connection to mysql 首先打开与mysql的连接

mysql -u root -p -h localhost

after successfully logging in 成功登录后

execute 执行

USE arc_logon;
SHOW TABLES;

This will give you a list of all tables in arc_logon. 这将为您提供arc_logon中所有表的列表。 If you can find the 'accounts' table then you should run the query and it will work 如果您可以找到“帐户”表,则应运行查询,该查询将起作用

USE arc_logon;
INSERT INTO `accounts` (login, password, gm, flags, banned) VALUES ('your-login-name', 'your-password', 'az', '24', '0'); 

Or you can also do this 或者您也可以这样做

SELECT * FROM information_schema.tables where table_schema = 'arc_logon' AND table_name= 'accounts'

If the above query return a single row, then the insert should work otherwise create the accounts table as it does not exists in this database. 如果以上查询返回一行,则该插入应该起作用,否则将创建accounts表,因为该数据库中不存在该表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM