mit-pdos / noria-mysql

MySQL/MariaDB protocol shim for Noria
MIT License
67 stars 15 forks source link

connection credentials (user, pass) #16

Closed chmoder closed 4 years ago

chmoder commented 4 years ago

Hi, my background with installing mysql includes either setting a root user password in a configuration file or as part of the install process. What is the desired method for noria-mysql? I have noria, noria-mysql, and noria-ui all running (nice job on the docs by the way). When I try to connect I see:

Jun 03 03:34:32.662 INFO listening on address 0.0.0.0:3306
  39.155999624s ERROR noria_mysql::backend: query can't be parsed
jonhoo commented 4 years ago

Hi there! There is currently no support for authentication with noria-mysql. Any username/password combination will work.

The particular error you are seeing suggests that the query you are issuing couldn't be parsed by https://github.com/ms705/nom-sql. Does it not give you a more detailed error message?

chmoder commented 4 years ago

I will look deeper into this, but when running diesel migration run There is a message like this:

thread 'conn-4' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorMessage { msg: "no view or table named \'__diesel_schema_migrations\'" }', src/backend.rs:1020:21

Indicating that i need to create a table called __diesel_schema_migrations. Can you give me an example of how you would do that?

another example

database setup --database-url mysql://root:pass@127.0.0.1/myapp
failed to parse query
jonhoo commented 4 years ago

Ah, I highly doubt that a db migration tool will work against Noria. They usually rely on a bunch of database-isms, such as being able to issue special commands to check whether a particular table already exists. If you wanted to do this normally, you'd just issue a CREATE TABLE against noria-mysql. You should be able to just connect manually with something like the mysql command-line tool :)

chmoder commented 4 years ago

You are correct!

mysql -u root -p -h 127.0.0.1 with any password indeed lets me connect and CREAT TABLE worked as well.