Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database is not created #1

Open
fridzema opened this issue Sep 17, 2019 · 5 comments
Open

Database is not created #1

fridzema opened this issue Sep 17, 2019 · 5 comments
Labels
good first issue Good for newcomers

Comments

@fridzema
Copy link

Hello,

I am trying to use your action, but the database isn't created.
Is use the following config:

      - uses: mirromutth/[email protected]
        with:
          host port: 3800 # Optional, default value is 3306. The port of host
          container port: 3307 # Optional, default value is 3306. The port of container
          character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
          collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
          mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
          mysql database: 'test' # Optional, default value is "test". The specified database which will be create
          mysql root password: 'root' # Required if "mysql user" is empty, default is empty. The root superuser password
          mysql user: 'root' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Of course you can use secrets, too
          mysql password: 'root' # Required if "mysql user" exists. The password for the "mysql user"

I get the following error further in the process:

SQLSTATE[HY000] [1049] Unknown database 'test' (SQL: select * from information_schema.tables where table_schema = test and table_name = system_models and table_type = 'BASE TABLE')

Any idea?

@J4Wx
Copy link

J4Wx commented Sep 17, 2019

I'm having this same issue.

SQLSTATE[HY000] [1049] Unknown database '***' (SQL: selec t * from information_schema.tables where table_schema = *** and table_name = migrations and table_type = 'BASE TABLE')

@mirromutth
Copy link
Owner

mirromutth commented Sep 19, 2019

Hi there, thanks for your report.

It is work to me, see https://github.com/mirromutth/r2dbc-mysql/blob/master/.github/workflows/build.yml

And, please keep mysql user empty if you have defined mysql root password. The mysql user option will create a superuser for the specified database, but it is not root superuser. Of course this is not the cause of this problem.

I will try create test cases to reproduce this scene.

@mirromutth mirromutth added the good first issue Good for newcomers label Sep 19, 2019
@mirromutth
Copy link
Owner

@J4Wx @fridzema

I try create test cases for this problem but I can not reproduce it. What have I missed? See https://github.com/mirromutth/mysql-action/blob/master/.github/workflows/test.yml and https://github.com/mirromutth/mysql-action/blob/master/test

Thanks for your time

@eugbyte
Copy link

eugbyte commented Mar 12, 2022

I am experiencing the same issue

your test cases do not include test the databases created

To reproduce

      - name: Shutdown Default Ubuntu MySQL (SUDO)
        run: sudo service mysql stop
      - name: Install MySQL
        uses: mirromutth/[email protected]
        with:
          host port: 3306
          container port: 3306
          mysql version: '8.0'
          mysql database: 'my_db'  <--- default db to initalize
          mysql user: root
          mysql password: root
          
      - name: Start MySQL
        run: sudo service mysql start
      - name: Verify MySQL
        run: mysql --user=root --password=root
      - name: List existing SQL databases
        run: mysql --user=root --password=root --execute="show databases;" <--- my_db is not shown

my_db is not shown

Database
information_schema
mysql
performance_schema
sys

@ricardonolan
Copy link

I had the same issue, problem is that for some reason, local mysql is still running (or some other version).
Run this instead:
mysql -h 127.0.0.1 --user=root --password=root --execute="show databases;"
and your db should be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants