Database created on both nodes but no tables

Comments

5 comments

  • Avatar
    Johan

    Hi Dave,

    You need to specify

    engine=ndbcluster

    instead of

    engine=innodb

    Drop your table Notes, and recreate it with engine=ndbcluster and you should be fine.

    Thank you,

    Johan

    0
    Comment actions Permalink
  • Avatar
    Dave Davies

    Johan,

    Thanks for the reply, so given a somewhat huge sql file to inject would I need to modify every table to ndbcluster  or is there a config param that needs changing ?

    0
    Comment actions Permalink
  • Avatar
    Johan

    Hi Dave,

    Do you have "engine=innodb" written in the SQL file then you have two options:

    1. sed -i.bak 's#InnoDB#ndbcluster#g' huge.sql
    2. load in the big dump (in innodb) and then do for all tables:
      ALTER TABLE nnnn ENGINE=ndbcluster

    (please note that you can leave out the ".bak" after the -i, but i recommend you replace with sed and keep an backup just in case)

    If you don't have ENGINE=InnoDB in the SQL dump , your tables are just listed as:

    CREATE TABLE (...)

    without the ENGINE= suffix then you can add in my.cnf (edit mysqlcluster-71/cluster/config/my.cnf),  in the [MYSQLD] group section:

    default-storage-engine=ndbcluster

    Then stop and start the mysql servers:

    ./stop-mysqld --hostname=x

    ./start-mysqld --hostname=x

    Please let me know what works for you!

    0
    Comment actions Permalink
  • Avatar
    Dave Davies

    Johan,

    Thanks, I have tried this on my small test inserts and set the default for the session with 

    set storage_engine=ndbcluster;

    I have modified the engine defaults in my.cnf and restarted the nodes and this all appears to be working.

    Great! all that remains is a real sql insert with some proper data.

    final question (for now!)

    Is there a quick easy way to modify the root mysql password across the cluster, or is it as easy as changing it on one node

    Dave

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Johan

    hi,

    Two options:

    1. From the web interface do Schema Management --> Privileges
    2. From scripts:
      cd mysqlcluster-71/cluster/scripts/tools
      ./execute-all-mysql.sh -uroot -p<password> -e "GRANT ALL ON *.* TO 'root'@'<ip>' IDENTIFIED BY '<new password>'

    Good luck,

    J

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk