按照(https://docs.wso2.com/display/Governance450/Setting+up+with+MySQL)说明我收到错误:
mysql> -u regadmin -p -Dregdb < 'D:\Programs\wso2greg-5.1.0\dbscripts\mysql.sql';
ERROR 1064 (42000): 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 '-u regadmin -p -Dregdb < 'D:\Programs\wso2greg-5.1.0\dbscripts\mysql.sql'' at line 1
步骤是:
create database regdb character set latin1;
GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin";
FLUSH PRIVILEGES;
use regdb
show tables;
quit;
我确认已复制的驱动程序 - mysql_connector_java_5.1.38_bin_1.0.0.jar。
我确认已更新默认数据源 - master-datasources.xml。
我没有配置任何新的数据源 - 我认为我不需要它们。
然后我尝试创建数据库表但上面得到错误。运行“wso2server.bat -Dsetup”只会生成以下异常,我假设是因为我没有表。
[2015-12-10 18:00:41,251] ERROR {org.wso2.carbon.user.core.util.DatabaseUtil} - Database Error - Incorrect string value: '\xE2\x80\x91200...' for column 'UM_DESCRIPTION' at row 1 java.sql.SQLException: Incorrect string value: '\xE2\x80\x91200...' for column 'UM_DESCRIPTION' at row 1
我猜它会变得微不足道 - 我只是看不到它。我试过玩mysql语法,但无济于事。我注意到Governance450文档说这些表是自动创建的。我假设460是有效的修正?
- 更新 部分解决:不确定上面究竟出了什么问题(如果有的话)。但是后面确实创建了表:(&gt;来自dos提示符,mysql&gt;来自mysql提示符)
> mysql -u root -p
--mysql> drop database if exists regdb;
mysql> create database regdb character set latin1;
--mysql> DROP USER ‘regadmin’@‘localhost’;
mysql> CREATE USER 'regadmin'@'localhost' IDENTIFIED BY 'regadmin';
mysql> GRANT ALL PRIVILEGES ON regdb.* TO 'regadmin'@'localhost';
> mysql -u regadmin -p
mysql> use regdb
mysql> source D:\Programs\wso2greg-5.1.0\dbscripts\mysql.sql;
mysql> show tables;
答案 0 :(得分:0)
我最终为我工作的步骤是: -
> mysql -u root -p
--mysql> drop database if exists regdb;
mysql> create database regdb;
--mysql> DROP USER ‘regadmin’@‘localhost’;
mysql> CREATE USER 'regadmin'@'localhost' IDENTIFIED BY 'regadmin';
mysql> GRANT ALL PRIVILEGES ON regdb.* TO 'regadmin'@'localhost';
> mysql -u regadmin -p
mysql> use regdb
mysql> source D:\Programs\wso2greg-5.1.0\dbscripts\mysql.sql;
mysql> show tables;
,其中
Dos prompt >
mysqlprompt mysql>