我有一个现有的MySQL实例(测试),包含2个数据库和一些用户,每个用户对每个数据库具有不同的访问权限.
我现在需要复制其中一个数据库(进入生产)和与之关联的用户.
复制数据库很简单:
出口:
mysqldump --no-data --tables -u root -p secondb >> secondb_schema.sql
Run Code Online (Sandbox Code Playgroud)
进口:
mysql -u root -p -h localhost secondb < secondb_schema.sql
Run Code Online (Sandbox Code Playgroud)
我没有找到,但是,导出和导入一个简单的方法的用户,在命令行(内部或外部的MySQL).
如何从命令行导出和导入用户?
更新:到目前为止,我已经找到了完成此操作的手动(因此容易出错)的步骤:
-- lists all users
select user,host from mysql.user;
Run Code Online (Sandbox Code Playgroud)
然后找到它的补助金:
-- find privilege granted to a particular user
show grants for 'root'@'localhost';
Run Code Online (Sandbox Code Playgroud)
然后使用上面"show grants"命令的结果中列出的授权手动创建用户.
我更喜欢更安全,更自动化的方式.有吗?
我pom.xml
只包含一个对SLF4J的引用:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.10</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
SLF4J:无法加载类"org.slf4j.impl.StaticLoggerBinder".
SLF4J:默认为无操作(NOP)记录器实现SLF4J:
有关更多详细信息,请参见http://www.slf4j.org/codes.html#StaticLoggerBinder.
我检查了那个URL,实际上它提供了一个解决方案:"放置一个(只有一个)slf4j-nop.jar,slf4j-simple.jar,slf4j-log4j12.jar,slf4j-jdk14.jar或logback-classic.jar on 类路径应该解决问题."
我的问题是:哪个类路径?
.classpath
?(我想我试过这个,但没有帮助)我发现相当一些关于这个问题的帖子在这里对SO,但他们都引用同样的答案:"地方......在类路径 ".
哪个类路径?
我想在我的pom.xml中使用onejar-maven-plugin:
<plugin>
<groupId>org.dstovall</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<configuration>
<mainClass>com.exmaple.myproj.MpPort_MpSoapPort_Client</mainClass>
<onejarVersion>0.97</onejarVersion>
<attachToBuild>true</attachToBuild>
<classifier>onejar</classifier>
</configuration>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<pluginRepositories>
<pluginRepository>
<id>onejar-maven-plugin.googlecode.com</id>
<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
</pluginRepository>
</pluginRepositories>
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,尝试通过Eclipse Maven插件(Maven安装)构建它会导致BUILD ERROR:
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's …
Run Code Online (Sandbox Code Playgroud) 什么是exported
属性在此的.classpath行吗?
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
Run Code Online (Sandbox Code Playgroud)
我已经得到了建立和细运行的项目,并没有它.那么,它有什么不同呢?
显然在我的特定情况下(我继承的一个项目),拥有它并不重要.何时添加此属性至关重要?
我错误地点击了"在Eclipse偏好(实验)中Eclipse构建中忽略的标记目标运行":
在哪里/如何撤消这个?
我pom.xml
包含以下内容,为具有下面指定的WSDL的工作Web服务自动生成客户端:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>generate-sources</id>
<configuration>
<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/wsdl/myclient.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
<extraarg>-verbose</extraarg>
</extraargs>
<wsdlLocation>wsdl/myclient.wsdl</wsdlLocation>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
项目构建正常,没有任何错误或警告,我可以在文件夹myclient.wsdl
下的JAR文件中看到该wsdl
文件.
但是当我尝试运行那个JAR时:
java -Xmx1028m -jar myclient-jar-with-dependencies.jar
Run Code Online (Sandbox Code Playgroud)
它抱怨"无法从wsdl/myclient.wsdl初始化默认的wsdl"
为什么?
我错过了什么?
我如何找出什么路径是wsdl/myclient.wsdl
在pom.xml中转化为,使客户的JAR抱怨在运行时?
更新:我知道一些涉及修改自动生成代码的解决方案/解决方法:
但是我更感兴趣的是一个解决方案,需要输入正确的值pom.xml
类似于类路径方法(但遗憾的是,由于某种原因,类路径不适合我).
相反,我应该在那里打字的任何想法?显然,这是一个非常简单的例子,可以找出该特定插件的正确路径规则,但我遗漏了一些东西而且我不知道它是什么.
我继承了一个基于CXF/Hibernate/JBoss的项目,其中包含一个名为的文件名database.xsd
.我梳理了项目以找出系统中使用的子系统/组件,database.xsd
但是在maven-war-plugin使用的文件中只产生了一个引用来创建WAR文件(webapp-cache.xml).
对我来说,这表明database.xsd
某些框架或插件需要一些标准文件名.但是这是什么?休眠?CXF?其他?
是否有文档实际描述了database.xsd
依赖它的包中的角色?
更新:暂时删除database.xsd
并尝试重建,导致大量编译错误导致XML2SQL.java
使用*.hbm.xml
DTO文件引用的包的主要文件.这告诉我,罪魁祸首是...... 休眠!
我设法正确配置基于CXF的客户端,以便为运行Web服务的服务器找到正确的SSL证书:
<http:conduit name="https://myserver/myws/register/soap?wsdl:{http://glob.reg.com/myws}.http-conduit">
<http:tlsClientParameters>
<sec:keyManagers keyPassword="changeit">
<sec:keyStore type="JKS" password="changeit"
file="C:\Program Files (x86)\Java\jdk1.6.0_45\jre\lib\security\cacerts"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore type="JKS" password="changeit"
file="C:\Program Files (x86)\Java\jdk1.6.0_45\jre\lib\security\cacerts"/>
</sec:trustManagers>
<sec:cipherSuitesFilter>
<!-- these filters ensure that a ciphersuite with
export-suitable or null encryption is used,
but exclude anonymous Diffie-Hellman key change as
this is vulnerable to man-in-the-middle attacks -->
<sec:include>.*_EXPORT_.*</sec:include>
<sec:include>.*_EXPORT1024_.*</sec:include>
<sec:include>.*_WITH_DES_.*</sec:include>
<sec:include>.*_WITH_AES_.*</sec:include>
<sec:include>.*_WITH_NULL_.*</sec:include>
<sec:exclude>.*_DH_anon_.*</sec:exclude>
</sec:cipherSuitesFilter>
</http:tlsClientParameters>
<http:authorization>
<sec:UserName>Betty</sec:UserName>
<sec:Password>password</sec:Password>
</http:authorization>
<http:client AutoRedirect="true" Connection="Keep-Alive"/>
</http:conduit>
Run Code Online (Sandbox Code Playgroud)
但是......因为证书是针对与我服务器的机器不同的子域名(映射到相同的IP地址),我收到以下错误:
Caused by: java.io.IOException: The https URL hostname does not match the Common Name …
Run Code Online (Sandbox Code Playgroud) 我发现了一个关于添加-fe jaxws21
到wsdl2java命令以使其生成jaxws 2.1兼容代码而不是2.2的重要提示,但Maven's pom.xml
似乎不喜欢这样的添加:
<goals>
<goal>wsdl2java -fe jaxws21</goal>
</goals>
Run Code Online (Sandbox Code Playgroud)
为pom.xml中使用的wsdl2java指定前端的正确方法是什么?
我执行下面(的Oracle 11g)的SQL语句,以增加从VARCHAR2(20 CHAR)到VARCHAR2(50 CHAR)现有列的长度:
ALTER TABLE USERX.MY_TABLE MODIFY (LASTNAME VARCHAR2(50));
Run Code Online (Sandbox Code Playgroud)
它没有发生任何事故,但当我看到新Data Type
专栏时,我看到:VARCHAR2(50 BYTE)
而不是VARCHAR2(50 CHAR)
.
我的问题是:
VARCHAR2(100 CHAR)
?