sqlyog

Mysql 环境部署

风流意气都作罢 提交于 2020-01-06 21:57:51
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.Window 1.1 下载软件: https://dev.mysql.com/downloads/mysql/ 依次点击上图 红色框中按钮 1.2 安装软件 1.2.1 解压软件 正常解压即可 目录 D:\mysql-8.0.18-winx64 1.2.2 配置 在 D:\mysql-8.0.18-winx64 目录里创建一个my.ini的文件,内容为: [client] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] # 设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=D:\\mysql-8.0.18-winx64 # 设置 mysql数据库的数据的存放目录,MySQL 8+ 不需要以下配置,系统自己生成即可,否则有可能报错 # datadir=D:\\mysql-8.0.18-winx64\\sqldata # 允许最大连接数 max_connections=20 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB 1.3 启动 使用 管理员权限启动

利用SSH桥接访问服务器的Docker运行的MySql服务

橙三吉。 提交于 2020-01-06 14:29:35
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前情提要 docker的运用越来广泛,许多IT公司都已经将自己的服务跑在Docker上面。在安全性方面又做了一层防护。比如:跑在Docker上的Mysql不做外网端口映射,只能在linux服务器上或进入docker访问mysql,这样对开发者来说是有些不方便的。 那么,其实这种情况,我们也是有办法可以做到在本地连接docker里面的MySql数据库的。 环境: Linux服务器:centos 7.7 服务器IP:192.168.1.5 容器:docker 实例IP:172.17.0.2 数据库:mysqld 5.7.28 数据库客户端:navicat ,sqlyog docker运行 通常我们运行docker实例的命令如: [root@qinshengfei ~]# docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=attack docker.io/mysql 通常这样运行起来的服务有几个问题 1、没有配置固定ip,这样一台服务器上跑多个docker服务,在以后重启的时候,ip地址会变 2、ip没有映射,对生产环境来说这不是问题,测试环境和开发环境,这样就很不方便 所以使用docker之前先做规划,是好习惯 客户端配置 sqlyog配置 1

Why I cannot assign foreign key to this column?

五迷三道 提交于 2020-01-06 06:54:45
问题 I've got a main table of users create table `users` ( `id` int (10), `first_name` varchar (192), `last_name` varchar (192), `password` varchar (96), `phone` int (10), `email` varchar (768), `date_created` timestamp ); then I have a table of accounts, with foreign key user_id referring to main table of users create table `accounts` ( `id` int (10), `user_id` int (11), `account_number` bigint (12), `account_type` varchar (192), `balance` double , `currency` varchar (9), `date_created` timestamp

Why I cannot assign foreign key to this column?

假如想象 提交于 2020-01-06 06:54:27
问题 I've got a main table of users create table `users` ( `id` int (10), `first_name` varchar (192), `last_name` varchar (192), `password` varchar (96), `phone` int (10), `email` varchar (768), `date_created` timestamp ); then I have a table of accounts, with foreign key user_id referring to main table of users create table `accounts` ( `id` int (10), `user_id` int (11), `account_number` bigint (12), `account_type` varchar (192), `balance` double , `currency` varchar (9), `date_created` timestamp

Where in the relevant specification is it documented that some comments in a SQL script are, in fact, to be executed as valid SQL (by MySQL)?

耗尽温柔 提交于 2020-01-04 09:22:10
问题 While browsing a SQL dump generated by the program SQLYog for a MySQL 5.6.16 database, I noticed that every stored procedure CREATE statement was surrounded by comment characters ( /* */ ). However, the stored procedures were created when the SQL script was executed. I was surprised both to see the comments surrounding the stored procedure CREATE statements, and then to see that these commented statements were, in fact, executed. Seeing that this did occur, I assumed that in fact either the

Where in the relevant specification is it documented that some comments in a SQL script are, in fact, to be executed as valid SQL (by MySQL)?

一笑奈何 提交于 2020-01-04 09:19:33
问题 While browsing a SQL dump generated by the program SQLYog for a MySQL 5.6.16 database, I noticed that every stored procedure CREATE statement was surrounded by comment characters ( /* */ ). However, the stored procedures were created when the SQL script was executed. I was surprised both to see the comments surrounding the stored procedure CREATE statements, and then to see that these commented statements were, in fact, executed. Seeing that this did occur, I assumed that in fact either the

What is the proper if clause syntax for a MySQL stored function?

牧云@^-^@ 提交于 2020-01-04 04:38:06
问题 I am brand new to MySQL, so I apologize if some of this is relatively elementary. I'm trying to write a stored function to round a digit to a certain number of significant figures. I have a function which, in theory, should work - I consulted another helpful StackOverflow to nail down the logic (Round to n Significant Figures in SQL). However, numbers between 1 and -1 (excluding 0, because I threw in the edge case catch) fail to round appropriately; for instance, a call of sfround(

Error: 1449, “The user specified as a definer ('root'@'localhost') does not exist”

試著忘記壹切 提交于 2019-12-13 16:05:03
问题 I get the above error when I try to retrieve data or insert data via my app to my database. The proc code is as follows CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_createUser`( IN p_name VARCHAR(20), IN p_username VARCHAR(20), IN p_password VARCHAR(20) ) BEGIN if ( select exists (select 1 from tbl_user where user_username = p_username) ) THEN select 'Username Exists !!'; ELSE insert into tbl_user ( user_name, user_username, user_password ) values ( p_name, p_username, p_password ); END IF

Importing .sql into MS Access using OBDC

蹲街弑〆低调 提交于 2019-12-12 05:49:09
问题 I currently have a database in MySQL, which I'd like to import in MS Access. Is it possible to do this while keeping all relationships intact (i.e. without exporting to .csv, or by using ODBC)? I'm a noob in this area so any help is greatly appreciated. Thanks. 回答1: You need to solve two different problems: Creating an empty MS Access database with a structure that matches the MySQL database structure. Extracting the data from MySQL and loading it into MS Access. This is not easy because

Setting MySQL connection/server to utf8mb4 instead of uft8 is breaking stored procedures in SQLYog

时光总嘲笑我的痴心妄想 提交于 2019-12-12 05:38:08
问题 Whether I try to open the stored procedures or create a new one SQLYog is giving the following error: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4' They can execute correctly from the server, but on SQLYog they keep giving this error code. I temporarily solved the issue with SET collation_connection = @@collation_database; but I was wondering if there's a more permanent solution? 回答1: From SQLyog: SET NAMES 'utf8mb4' COLLATE 'utf8_bin'; Error Code: 1253 COLLATION 'utf8_bin' is