Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

demo of MySQL setup in a CoCalc project

Views: 430

Setting up MySQL in a CoCalc project

Walkthrough

mkdir ~/MYSQL cd ~/MYSQL wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz tar -xf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz export MYSQL_HOME=/home/user/MYSQL/mysql-8.0.11-linux-glibc2.12-x86_64 cd $MYSQL_HOME mkdir data log vi my.cnf ...contents [mysqld] user=user vi my.ini ...contents export BASE_DIR=$MYSQL_HOME export DATADIR=$BASE_DIR/data

Create scripts. I'm putting them in ~/MYSQL. Run scripts as follows:

  • initialize with mysq.sh --initialize

    • capture initial root password from log/mysql.err

  • start the server with mysq.sh

  • (optional) in another terminal session, tail -f .../log/mysql.err

  • in another terminal session, start a client with mysqc.sh -u root -p

    • use the root password from previous step

    • set new password with

      SET PASSWORD = 'xxxxxxx';