前提・実現したいこと
sql初心者です.
node.jsでエンジニア様にプログラムを作っていただきました.
sqlのファイルがあったため,自分のmysqlにリストアをして,
mysqlをスタートさせながらコードを実行すると
以下のようなメッセージが...
ちなみに自分が行なったことは
mysql -u rootからmysqlに.sqlファイルをリストア
startをさせながら,node.jsを使うとエラーが出ます
発生している問題・エラーメッセージ
motegiyuuta:fms
1 2> fms@0.0.0 start /Users/motegiyuta/Desktop/fms-master 3> nodemon ./bin/www 4 5[nodemon] 1.19.0 6[nodemon] to restart at any time, enter `rs` 7[nodemon] watching: *.* 8[nodemon] starting `node ./bin/www` 9 10error connecting: Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested b 11y server; consider upgrading MySQL client 12 at Handshake.Sequence._packetToError (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/s 13equences/Sequence.js:47:14) 14 at Handshake.ErrorPacket (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/sequences/Han 15dshake.js:123:18) 16 at Protocol._parsePacket (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/Protocol.js:2 1791:23) 18 at Parser._parsePacket (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/Parser.js:433:1 190) 20 at Parser.write (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/Parser.js:43:10) 21 at Protocol.write (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/protocol/Protocol.js:38:16) 22 at Socket.<anonymous> (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/Connection.js:91:28) 23 at Socket.<anonymous> (/Users/motegiyuta/Desktop/fms-master/node_modules/mysql/lib/Connection.js:525:10) 24 at Socket.emit (events.js:196:13) 25 at addChunk (_stream_readable.js:290:12) 26 -------------------- 27エラーメッセージ
該当のソースコード
sql
1-- phpMyAdmin SQL Dump 2-- version 4.7.0 3-- https://www.phpmyadmin.net/ 4-- 5-- Host: 127.0.0.1 6-- Generation Time: May 31, 2019 at 06:44 AM 7-- Server version: 10.1.24-MariaDB 8-- PHP Version: 7.1.6 9 10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11SET AUTOCOMMIT = 0; 12START TRANSACTION; 13SET time_zone = "+00:00"; 14 15 16/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19/*!40101 SET NAMES utf8mb4 */; 20 21-- 22-- Database: `fms` 23-- 24 25-- -------------------------------------------------------- 26 27-- 28-- Table structure for table `equipments` 29-- 30 31CREATE TABLE `equipments` ( 32 `id` int(11) NOT NULL, 33 `process_id` int(11) NOT NULL, 34 `name` text NOT NULL, 35 `process_name` text NOT NULL 36) ENGINE=InnoDB DEFAULT CHARSET=latin1; 37 38-- 39-- Dumping data for table `equipments` 40-- 41 42INSERT INTO `equipments` (`id`, `process_id`, `name`, `process_name`) VALUES 43(49, 31, 'Process 1 Equipment 1', 'Process 1 Bread'), 44(50, 31, 'Process 2 Equipment 1', 'Process 1 Bread'), 45(51, 32, 'Process 2 Equipment 2', 'Process 2 Bread'); 46 47-- -------------------------------------------------------- 48 49-- 50-- Table structure for table `operations` 51-- 52 53CREATE TABLE `operations` ( 54 `id` int(11) NOT NULL, 55 `equipment_id` int(11) NOT NULL, 56 `name` text NOT NULL, 57 `time` text NOT NULL, 58 `quantity` text NOT NULL 59) ENGINE=InnoDB DEFAULT CHARSET=latin1; 60 61-- 62-- Dumping data for table `operations` 63-- 64 65INSERT INTO `operations` (`id`, `equipment_id`, `name`, `time`, `quantity`) VALUES 66(2, 49, 'Process 1 eq 1 op1', '5', '30'), 67(3, 50, 'pro2eq2op1', '10', '100'); 68 69-- -------------------------------------------------------- 70 71-- 72-- Table structure for table `orders` 73-- 74 75CREATE TABLE `orders` ( 76 `id` int(11) NOT NULL, 77 `product_id` int(11) NOT NULL, 78 `start_date` date NOT NULL, 79 `delivery_date` date NOT NULL, 80 `quantity` int(11) NOT NULL 81) ENGINE=InnoDB DEFAULT CHARSET=latin1; 82 83-- 84-- Dumping data for table `orders` 85-- 86 87INSERT INTO `orders` (`id`, `product_id`, `start_date`, `delivery_date`, `quantity`) VALUES 88(4, 41, '2019-05-22', '2019-05-29', 1000); 89 90-- -------------------------------------------------------- 91 92-- 93-- Table structure for table `order_detail` 94-- 95 96CREATE TABLE `order_detail` ( 97 `id` int(11) NOT NULL, 98 `order_id` int(11) NOT NULL, 99 `process_id` int(11) NOT NULL, 100 `equipment_id` int(11) NOT NULL, 101 `operation_id` int(11) NOT NULL, 102 `operation_start` text NOT NULL, 103 `operation_end` text NOT NULL, 104 `lock_status` int(11) NOT NULL 105) ENGINE=InnoDB DEFAULT CHARSET=latin1; 106 107-- 108-- Dumping data for table `order_detail` 109-- 110 111INSERT INTO `order_detail` (`id`, `order_id`, `process_id`, `equipment_id`, `operation_id`, `operation_start`, `operation_end`, `lock_status`) VALUES 112(1, 4, 31, 49, 2, '2019-05-22T04:50', '2019-05-22T04:50', 1), 113(2, 4, 31, 50, 3, '2019-05-23T06:50', '2019-05-23T06:50', 0); 114 115-- -------------------------------------------------------- 116 117-- 118-- Table structure for table `process` 119-- 120 121CREATE TABLE `process` ( 122 `id` int(11) NOT NULL, 123 `product_id` int(11) NOT NULL, 124 `name` text NOT NULL, 125 `product_name` text NOT NULL 126) ENGINE=InnoDB DEFAULT CHARSET=latin1; 127 128-- 129-- Dumping data for table `process` 130-- 131 132INSERT INTO `process` (`id`, `product_id`, `name`, `product_name`) VALUES 133(31, 41, 'Process 1 Bread', 'Bread'), 134(32, 41, 'Process 2 Bread', 'Bread'), 135(33, 41, 'Process 3 Bread', 'Bread'); 136 137-- -------------------------------------------------------- 138 139-- 140-- Table structure for table `products` 141-- 142 143CREATE TABLE `products` ( 144 `id` int(11) NOT NULL, 145 `name` text NOT NULL 146) ENGINE=InnoDB DEFAULT CHARSET=latin1; 147 148-- 149-- Dumping data for table `products` 150-- 151 152INSERT INTO `products` (`id`, `name`) VALUES 153(41, 'Bread'); 154 155-- 156-- Indexes for dumped tables 157-- 158 159-- 160-- Indexes for table `equipments` 161-- 162ALTER TABLE `equipments` 163 ADD PRIMARY KEY (`id`); 164 165-- 166-- Indexes for table `operations` 167-- 168ALTER TABLE `operations` 169 ADD PRIMARY KEY (`id`); 170 171-- 172-- Indexes for table `orders` 173-- 174ALTER TABLE `orders` 175 ADD PRIMARY KEY (`id`); 176 177-- 178-- Indexes for table `order_detail` 179-- 180ALTER TABLE `order_detail` 181 ADD PRIMARY KEY (`id`); 182 183-- 184-- Indexes for table `process` 185-- 186ALTER TABLE `process` 187 ADD PRIMARY KEY (`id`); 188 189-- 190-- Indexes for table `products` 191-- 192ALTER TABLE `products` 193 ADD PRIMARY KEY (`id`); 194 195-- 196-- AUTO_INCREMENT for dumped tables 197-- 198 199-- 200-- AUTO_INCREMENT for table `equipments` 201-- 202ALTER TABLE `equipments` 203 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52; 204-- 205-- AUTO_INCREMENT for table `operations` 206-- 207ALTER TABLE `operations` 208 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 209-- 210-- AUTO_INCREMENT for table `orders` 211-- 212ALTER TABLE `orders` 213 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; 214-- 215-- AUTO_INCREMENT for table `order_detail` 216-- 217ALTER TABLE `order_detail` 218 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; 219-- 220-- AUTO_INCREMENT for table `process` 221-- 222ALTER TABLE `process` 223 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; 224-- 225-- AUTO_INCREMENT for table `products` 226-- 227ALTER TABLE `products` 228 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;COMMIT; 229 230/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 231/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 232/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 233
試したこと
CREATE USER mydbuser@localhost IDENTIFIED BY 'password';
によりユーザーを作りました.
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答2件
あなたの回答
tips
プレビュー