install mysql on mac_Mysql Configuration on Mac

download mysql

goto the website

Download MySQL Community Server​dev.mysql.com

without login.

choose

macOS 10.13 (x86, 64-bit), DMG Archive

to download.install mysql

click / double-click by default to install, especially to maintain a password.start mysql

enter preference -> mysql -> start MYSQL serverconfigure mysql

add

SQL_HOME=/usr/local/mysql

PATH=$SQL_HOME/bin:$PATH

to bash_profile.

validate

source ~/.bash_profilelogin mysql

mysql -u root -p

enter passwordchange password

alter user root@localhost identified with mysql_native_password by 'newpassword'create a database

create database test;

show databases;create a table

use test;

show tables;

create table fire_tab(

fire_id INT NOT NULL AUTO_INCREMENT,

X INT NOT NULL,

Y INT NOT NULL,

FFMC FLOAT NOT NULL,

DMC FLOAT NOT NULL,

ISI FLOAT NOT NULL,

temp FLOAT NOT NULL,

RH INT NOT NULL,

wind FLOAT NOT NULL,

rain FLOAT NOT NULL,

area FLOAT NOT NULL,

PRIMARY KEY (fire_id)

);

show columns from fire_tab;delete a table

drop table fire_tabclear a table

delete from fire_tab

truncate table fire_tabadd a column to a table

alter table fire_tab add DC FLOAT NOT NULL;rearrange a column

alter table fire_tab modify DC FLOAT NOT NULL after DMCadd a record

insert into fire_tab (fire_id,X,Y,FFMC,DMC,DC,ISI,temp,RH,wind,rain,area) values(1,7,5,86.2,26.2,94.3,5.1,8.2,51,6.7,0,0)delete a record

delete from fire_tab where fire_id=1modify authority

mysql -u root -p

use mysql;

update user set host = '%' where user = 'root';

select host, user from user;

flush privileges;

or

mysql -u root -p

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;

flush privileges;modify data-type of a column

alter table firetab modify column fire_id bigint

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值