Comments (10)
Connection was tested used MariaDB Connector/J 1.5.9
You have two option for prepare the configuration for MariaDB using schemaspy.properties file:
schemaspy.t=mariadb
# optional path to alternative jdbc drivers.
schemaspy.dp=\drivers\mariadb-java-client-1.5.9.jar
# database properties: host, port number, name user, password
schemaspy.host=localhost
schemaspy.port=3306
schemaspy.db=database_name
schemaspy.u=root
schemaspy.p=password
# output dir to save generated files
schemaspy.o=\doc\schemaspy\output
# db scheme for which generate diagrams
schemaspy.charset=UTF-8
Configuration by command line parameters:
java -jar schemaspy.jar -t mariadb -dp \drivers\mariadb-java-client-1.5.9.jar -db dbName -host localhost -port 3306 -u root -p password -o \doc\schemaspy\output -charset=UTF-8
Please verify your case with connection and use SchemaSpy with MariaDB.
If everything start working as should please let me know or close the issue yourself.
from schemaspy.
Hi @rafalkasa
Thank you very much for your help. We have Puppet deployed env and I tried in several envs with the same issue. Here what I did. I posted a similar root password.
mysql sbmongodb
working fine.
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
rpm -qa | egrep 'maria|galera'
mariadb-galera-server-5.5.41-2.el7ost.x86_64
galera-25.3.5-7.el7.x86_64
mariadb-5.5.41-2.el7_0.x86_64
mariadb-libs-5.5.41-2.el7_0.x86_64
mariadb-galera-common-5.5.41-2.el7ost.x86_64
mkdir tgdmead2_tmp
cd tgdmead2_tmp
$ vi mariadb.properties
description=MariaDB
driver=org.mariadb.jdbc.Driver
connectionSpec=jdbc:mysql://127.0.0.1:3306/sbmongodb
driverPath=/root/tgdmead2_tmp/mariadb-java-client-1.5.9.jar
wget -nd 'https://downloads.mariadb.com/Connectors/java/connector-java-1.5.9/mariadb-java-client-1.5.9.jar'
wget -nd 'https://github.com/schemaspy/schemaspy/releases/download/v6.0.0-rc1/schemaspy-6.0.0-rc1.jar'
yum -y install jre1.8.0_77.x86_64
yum -y install graphviz-java
/usr/java/jre1.8.0_77/bin/java -jar /root/tgdmead2_tmp/schemaspy-6.0.0-rc1.jar -t mariadb -dp /root/tgdmead2_tmp/mariadb-java-client-1.5.9.jar -db sbmongodb -host localhost -port 3306 -u root -p IamR00tDBA -o /root/tgdmead2_tmp/sbmongodb -charset=latin1
Apr 25, 2017 11:30:40 AM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@30dae81: startup date [Tue Apr 25 11:30:40 CEST 2017]; root of context hierarchy
Apr 25, 2017 11:30:40 AM org.schemaspy.Config loadProperties
INFO: Configuration file not found
Using database properties:
/root/mariadb.properties
Failed to connect to database URL [jdbc:mysql://127.0.0.1:3306/sbmongodb]
java.sql.SQLInvalidAuthorizationSpecException: Could not connect: Access denied for user 'root'@'127.0.0.1' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:135)
at org.mariadb.jdbc.internal.util.ExceptionMapper.getException(ExceptionMapper.java:101)
at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:91)
at org.mariadb.jdbc.Driver.connect(Driver.java:109)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:66)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not connect: Access denied for user 'root'@'127.0.0.1' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:569)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.handleConnectionPhases(AbstractConnectProtocol.java:503)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:382)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:839)
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:479)
at org.mariadb.jdbc.Driver.connect(Driver.java:104)
... 5 more
11:30:40.524 WARNING: Main.main - Connection Failure
org.schemaspy.model.ConnectionFailure: java.sql.SQLInvalidAuthorizationSpecException: Could not connect: Access denied for user 'root'@'127.0.0.1' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:92)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Could not connect: Access denied for user 'root'@'127.0.0.1' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:135)
at org.mariadb.jdbc.internal.util.ExceptionMapper.getException(ExceptionMapper.java:101)
at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:91)
at org.mariadb.jdbc.Driver.connect(Driver.java:109)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:66)
... 4 more
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not connect: Access denied for user 'root'@'127.0.0.1' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:569)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.handleConnectionPhases(AbstractConnectProtocol.java:503)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:382)
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:839)
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:479)
at org.mariadb.jdbc.Driver.connect(Driver.java:104)
... 5 more
cat /etc/my.cnf.d/server.cnf
### MANAGED BY PUPPET ###
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[isamchk]
key_buffer_size = 16M
[mysqld]
basedir = /usr
bind-address = 0.0.0.0
datadir = /var/lib/mysql/data
default-storage-engine = InnoDB
expire_logs_days = 10
interactive_timeout = 2147483
key_buffer_size = 16M
log-error = /var/log/mariadb/mariadb.log
max_allowed_packet = 500M
max_binlog_size = 100M
max_connections = 15360
open_files_limit = 16384
pid-file = /var/run/mariadb/mariadb.pid
port = 3306
query_cache_limit = 1M
query_cache_size = 16M
skip-external-locking
socket = /var/lib/mysql/mysql.sock
ssl = false
ssl-ca = /etc/pki/galera/mysql.ca.crt
ssl-cert = /etc/pki/galera/mysql.crt
ssl-key = /etc/pki/galera/mysql.key
thread_cache_size = 8
thread_stack = 256K
tmpdir = /var/lib/mysql/tmp
user = mysql
wait_timeout = 2147483
[mysqld-5.0]
myisam-recover = BACKUP
[mysqld-5.1]
myisam-recover = BACKUP
[mysqld-5.5]
myisam-recover = BACKUP
[mysqld-5.6]
myisam-recover-options = BACKUP
[mysqld-5.7]
myisam-recover-options = BACKUP
[mysqld_safe]
log-error = /var/log/mariadb/mariadb.log
nice = 0
socket = /var/lib/mysql/mysql.sock
[mysqldump]
max_allowed_packet = 500M
quick
quote-names
cat /etc/my.cnf.d/galera.cnf | grep -v '^#'
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
query_cache_type=1
bind-address=0.0.0.0
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_provider_options="socket.ssl=false"
wsrep_cluster_name="galera_cluster"
wsrep_cluster_address="gcomm://x,y,z
wsrep_slave_threads=1
wsrep_certify_nonPK=1
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_debug=0
wsrep_convert_LOCK_to_trx=0
wsrep_retry_autocommit=1
wsrep_auto_increment_control=1
wsrep_drupal_282555_workaround=0
wsrep_causal_reads=0
wsrep_notify_cmd=
wsrep_sst_method=rsync
wsrep_sst_auth=sst_user:gvzuvuuhuizhi
skip-name-resolve=1
from schemaspy.
I found the issue. SchemaSpy connects via TCP (not socket).
# mysql --proto=tcp
ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 22329897
Server version: 5.5.41-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Here the solution: http://stackoverflow.com/a/37356782 Howto give that config option in schemaspy.properties
?
from schemaspy.
@GETandSELECT @rafalkasa
So I had nothing important to do so I tried it:
1, Download a unix socket library for java and it's dependencies:
junixsocket-common-2.0.4.jar
junixsocket-mysql-2.0.4.jar
junixsocket-native-2.0.4-x86_64-MacOSX-gpp-jni.nar <- Im on OSX
junixsocket-native-2.0.4.nar
mysql-connector-java-5.1.32.jar
native-lib-loader-2.1.5.jar
slf4j-api-1.7.25.jar
slf4j-simple-1.7.25.jar
lets put them all in a in a lib folder relative to schemaspy jar.
2, Create an extended dbtype i.e a new file: mysql_socket.properties
in same folder as schemaspy jar
extends=mysql
connectionSpec=jdbc:mysql://<host>/<db>?socketFactory=<socketFactory>&socket=<socket>
socketFactory=ClassName of socket factory which must be in your classpath
socket=Path To Socket
3, Everything should look something like
| schemaspy-6.0.0-rc1.jar
| mysql_socket.properties
+--\lib
+---| junixsocket-common-2.0.4.jar
+---| junixsocket-mysql-2.0.4.jar
+---| junixsocket-native-2.0.4-x86_64-MacOSX-gpp-jni.nar
+---| junixsocket-native-2.0.4.nar
+---| mysql-connector-java-5.1.32.jar
+---| native-lib-loader-2.1.5.jar
+---| slf4j-api-1.7.25.jar
+---| slf4j-simple-1.7.25.jar
4, Run schemaspy in all it's glory thru a socket
java -jar schemaspy-6.0.0-rc1.jar \
-t mysql_socket \
-dp lib/mysql-connector-java-5.1.32.jar:lib/junixsocket-common-2.0.4.jar:lib/junixsocket-native-2.0.4-x86_64-MacOSX-gpp-jni.nar:lib/mysql-connector-java-5.1.32.jar:lib/junixsocket-mysql-2.0.4.jar:lib/junixsocket-native-2.0.4.nar:lib/native-lib-loader-2.1.5.jar:lib/slf4j-api-1.7.25.jar:lib/slf4j-simple-1.7.25.jar \
-db [DBname] \
-host localhost \
-port 3306 \
-u [User] \
-socketFactory org.newsclub.net.mysql.AFUNIXDatabaseSocketFactory \
-socket [path to socket] \
-o [output dir]
That or just granting access to a user over TCP.
There might be some differences if mariadb connector is used.
But all in all, this has little to do with SchemaSpy.
I must say, there is little documentation about extending dbTypes.
You could hardcode the values for socketFactory and socket in mysql_socket.properties
or write the complete connectionString in the connectionSpec.
from schemaspy.
@npetzall your explanation and description is awesome. I have to reproduce the case with connection using socket to MySql and MariaDb step by step. I believe that based on your work and description it will be possible and doable.
from schemaspy.
I want to close this.
from schemaspy.
@npetzall if we would like to have support in the SchemaSpy for mysql_socket maybe we should close this issue and create another. What do you think ? In my opinion this socket support is very well described by you but maybe we should also consider to add such description to the official documentation.
To many tasks and things to do 😄
from schemaspy.
@rafalkasa new issue, close this.
from schemaspy.
@rafalkasa The properties file is in, as for the documentation should we add an advanced usage section?
from schemaspy.
This issue require finish documentation without well described how to configure mysql, mariadb using socket it will be not easy for others SchemaSpy users.
from schemaspy.
Related Issues (20)
- SchemaSpy automatically detects only Foreign Keys that reference a Primary Key HOT 7
- marcelstoer:chore/jar-noteAre there any objections to this PR marked as "important"? HOT 1
- Docker: arm image HOT 1
- Moving GUI components
- GUI does not respond to re-sizing HOT 1
- No relationships image created HOT 6
- Too much information in error.
- Sign snapshots
- Cant get line breaks in Table Comments to work. HOT 6
- I am unable to get comments
- Oracle database - null password given HOT 5
- Driver Error HOT 7
- Failed to parse [schema].meta.xml HOT 5
- Terminating null reference error when generating HTML for Constraints MSSQL HOT 1
- SchemaSpy ERD (relationship tab) is not showing lines between tables HOT 4
- Relationship between Unique Keys and Foreign Key HOT 8
- ERROR - Bad config Schema (-s/-schemas) was not provided and unable to deduce schema, ... HOT 2
- Trying to set trustServerCertificate true in schemaspy.connprops Property in config file does not work HOT 2
- Getting an Exception when running against Oracle database in charset ISO-8859-15 HOT 1
- Feature request: "Comment" as title in relationships.html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schemaspy.