[英]Where to issue mysql commands?
I am new to using mysql. 我是初次使用mysql。 First I connect to my web hosting SSH and then I use the following command to connect to the mysql server:
首先,我连接到Web托管SSH,然后使用以下命令连接到mysql服务器:
mysql -u mysqlusername -h server_ip -p (the server is not localhost, it is a remote server) mysql -u mysqlusername -h server_ip -p(服务器不是本地主机,它是远程服务器)
Then it prompts for the password, I enter it, and I am connected. 然后,提示输入密码,输入密码,然后连接。 I receive a mysql> prompt
我收到一个mysql>提示
Now I am trying to import a sql dump while preserving the charset. 现在,我尝试在保留字符集的同时导入sql dump。 I've looked around on the internet and apparently the command to use is
我在互联网上四处张望,显然使用的命令是
mysql -uUSERNAME -pPASSWORD –default-character-set=utf8 USER_DATABASE < backup.sql mysql -uUSERNAME -pPASSWORD –默认字符集= utf8 USER_DATABASE <backup.sql
but since I am already connected, I try to issue: –default-character-set=utf8 USER_DATABASE < backup.sql but a new line appears to enter a new command instantly and its not possible that the command has been executed because the sql backup is 20 mb. 但由于我已经连接了,所以我尝试发出:–default-character-set = utf8 USER_DATABASE <backup.sql,但是出现了新行,立即可以输入新命令,并且由于sql备份,不可能执行该命令是20 mb。 It does not do anything.
它什么也没做。
I am having encoding issues with my website. 我的网站存在编码问题。 The dump is in utf-8, all the special charachters show up as they should when I view the file using notepad, but for some reason as soon as I import the dump using phpmyadmin's import menu, I browse the tables and all the special characters are scrambled.
转储文件位于utf-8中,当我使用记事本查看文件时,所有特殊字符均应显示,但由于某种原因,一旦我使用phpmyadmin的导入菜单导入转储文件,便会浏览表和所有特殊字符被打乱了。 When I access the website the characters are scrambled.
当我访问网站时,字符被打乱了。 I added AddDefaultCharset UTF-8 to htaccess file, but to no avail.
我在htaccess文件中添加了AddDefaultCharset UTF-8,但无济于事。 This is why I want to try to import the dump using mysql command.
这就是为什么我想尝试使用mysql命令导入转储的原因。
You see there is a command 你看到有一个命令
mysql -u mysqlusername -h server_ip -p
and another one 还有一个
mysql -uUSERNAME -pPASSWORD –-default-character-set=utf8 USER_DATABASE < backup.sql
Did you try to merge them? 您是否尝试合并它们?
Such as 如
mysql -u mysqlusername -h server_ip -p –-default-character-set=utf8 USER_DATABASE < backup.sql
? ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.