CoCalc Public FilesPublic / mysql-setup.mdOpen with one click!
Author: Hal Snyder
Views : 113
Description: demo of MySQL setup in a CoCalc project
Compute Environment: Ubuntu 18.04 (Deprecated)

Setting up MySQL in a CoCalc project

Links

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';