Script #1

来源:互联网 发布:巨人网络 2017财报 编辑:程序博客网 时间:2024/05/21 21:41

Install

[15:11 fury ~]$ sudo dnf install mysql

[15:32 fury ~]$ sudo dnf install mysql-server

[17:00 fury ~]$ sudo dnf mysql-shell

Error

[15:54 fury ~]$ mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

solution:

[15:59 fury ~]$ service mysqld start

Error

[18:17 fury ~]$ mysqlsh
Welcome to MySQL Shell 1.0.9

Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘\help’, ‘\h’ or ‘\?’ for help, type ‘\quit’ or ‘\q’ to exit.

Currently in JavaScript mode. Use \sql to switch to SQL mode and execute queries.
mysql-js> \help

mysql-js> \sql
mysql-js> \py
Switching to Python mode…
mysql-py> import numpy as np
mysql-py> a = np.array([1])
mysql-py> a
array([1])

mysql-py> \sql
Switching to SQL mode… Commands end with ;
mysql-sql> create database weibo;
ERROR: Not connected.

mysql-js> \c root@localhost:3306
Creating a Session to ‘root@localhost:3306’
Enter password:
Classic Session successfully established. No default schema selected.
mysql-js> \sql
Switching to SQL mode… Commands end with ;
mysql-sql> create database weibo;
Query OK, 1 row affected (0.00 sec)

0 0
原创粉丝点击