I am using a software which must interact with MySQL database. I have installed this software (named stacks) and MySQL. There are two command when I use this software: ~/directory mysql -e "CRAETA DATABASE 1" ~/directory 1 < /usr/local/share/stacks/sql/stacks.sql I am a very new to linux system and MySQL. I know the first command is going to create a database in MySQL named 1. The manual of the software explains the second command as "send the database table definitions to the server to create all the necessary components of the database ". When I run the first command under MySQL, it is ok. But it will show "Error 1064: you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "1 < /usr/local/share/stacks /sql/stacks.sql" at line1" when I run the second command. I am wondering whether someone know what's the actual meaning of the second command. I am totally confused. PS: the software I used is "Stacks" and installed in the default path "/usr/ local/share/stacks". Thanks, everyone! I am in the lab and can't type in Chinese. Sorry.
the 2nd command is about creating tables in your database 1. if you are not familiar with linux, you can download and install MySQL Workbench on windows and log to your mysql server on linux. Then execute " stacks.sql" in MySQL Workbench.
when going explains to first
【在 s********2 的大作中提到】 : I am using a software which must interact with MySQL database. I have : installed this software (named stacks) and MySQL. There are two command when : I use this software: : ~/directory mysql -e "CRAETA DATABASE 1" : ~/directory 1 < /usr/local/share/stacks/sql/stacks.sql : I am a very new to linux system and MySQL. I know the first command is going : to create a database in MySQL named 1. The manual of the software explains : the second command as "send the database table definitions to the server to : create all the necessary components of the database ". When I run the first : command under MySQL, it is ok. But it will show "Error 1064: you have an
I*y
8 楼
install a MySQL management UI software such as phpmyadmin on your server, and then import the .sql file through the user interface, and it can track down what error (if any) it throws to you. the second command line is an attempt to import the mysql dump file. However, I think the command line is wrong, though I'm not sure what Linux distro you are using. If you are on the kernel prompt (e.g. ssh), use this command: mysql -u username -p database_name < /path/to/the/mysql/dump/directory/dumpfile.sql this command line assumes that your mysql server is your localhost. make sure the mysql username above has privilege to write to the database_name, or just use the root user. When you import the file, make sure it's an intact mysql dump, meaning you don't open it and save it. If you have opened it and saved it, some lines in the dump file may have been altered, throwing errors like this Error 1064.
when going explains to first
【在 s********2 的大作中提到】 : I am using a software which must interact with MySQL database. I have : installed this software (named stacks) and MySQL. There are two command when : I use this software: : ~/directory mysql -e "CRAETA DATABASE 1" : ~/directory 1 < /usr/local/share/stacks/sql/stacks.sql : I am a very new to linux system and MySQL. I know the first command is going : to create a database in MySQL named 1. The manual of the software explains : the second command as "send the database table definitions to the server to : create all the necessary components of the database ". When I run the first : command under MySQL, it is ok. But it will show "Error 1064: you have an
L*d
9 楼
stacks.sql这个文件里的某一个(些)statement有语法错误 打开那个文件看看
when going explains to first
【在 s********2 的大作中提到】 : I am using a software which must interact with MySQL database. I have : installed this software (named stacks) and MySQL. There are two command when : I use this software: : ~/directory mysql -e "CRAETA DATABASE 1" : ~/directory 1 < /usr/local/share/stacks/sql/stacks.sql : I am a very new to linux system and MySQL. I know the first command is going : to create a database in MySQL named 1. The manual of the software explains : the second command as "send the database table definitions to the server to : create all the necessary components of the database ". When I run the first : command under MySQL, it is ok. But it will show "Error 1064: you have an
Thanks, IVYtony! I am using Ubuntu 11.04. I changed the stacks.sql, and shouldn't have a problem with it any more. But when I run the second command , the error show up "error 1045 (28000): Access denied for user 'root'@' localhost' (using password : No)" . I googled the error. Most suggested resetting the password. But if I run "mysql -u root -p" and enter my password. I can get into the mysql. I am totally don't know how to do troubleshooting. I have been working on this for almost one week, starting installing the linux system, the software, and MySQL. I feel so frustrated. :( Any other suggestion would be greatly appreciated.
However, I think the command are on the kernel prompt (e.g. dumpfile.sql name, or just use the root user. don't open it and
【在 I*****y 的大作中提到】 : install a MySQL management UI software such as phpmyadmin on your server, : and then import the .sql file through the user interface, and it can track : down what error (if any) it throws to you. : the second command line is an attempt to import the mysql dump file. However, I think the command : line is wrong, though I'm not sure what Linux distro you are using. If you are on the kernel prompt (e.g. : ssh), use this command: : mysql -u username -p database_name < /path/to/the/mysql/dump/directory/dumpfile.sql : this command line assumes that your mysql server is your localhost. : make sure the mysql username above has privilege to write to the database_name, or just use the root user. : When you import the file, make sure it's an intact mysql dump, meaning you don't open it and