我在终端上使用了gcc命令来编译C程序但突然间,在我的Mac操作系统更新后(到macOS 10.14 Mojave和XCode 10.0),我开始收到消息:
test.c:8:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
我已经安装了gcc,因为我可以找到它/usr/local/bin并且那里确实有一个gcc.我尝试在我的其他iMac上运行相同的文件,它没有任何问题.
我试过运行xcode-select --install它已经安装好了,因此它没有解决我现在遇到的问题.我猜测路径搞砸了,因为gcc在我开始复制并粘贴其他资源中的一些命令来解决此问题后,它似乎无法找到.
希望对此有所帮助.
我已经安装了MySQL 8.0服务器和phpMyAdmin,但是当我尝试从浏览器访问它时,会发生以下错误:
#2054 - The server requested authentication method unknown to the client
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client
Run Code Online (Sandbox Code Playgroud)
我想它必须与实施的强密码和MySQL版本的相对新鲜度有关.
但我对最先进的驱动程序和连接配置一无所知.
有人遇到同样的问题并解决了吗?:d
使用apt安装编辑
apt-get install mysql-server phpmyadmin
Run Code Online (Sandbox Code Playgroud) 我更新了我用Homebrew安装的所有软件包.MySQL升级到5.6.12(从5.5.27左右):
$ mysql --version
mysql Ver 14.14 Distrib 5.6.12, for osx10.8 (x86_64) using EditLine wrapper
Run Code Online (Sandbox Code Playgroud)
现在mysql2 gem不再编译了:
$ gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/pupeno/.rvm/rubies/ruby-1.9.3-p429-perf/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile …Run Code Online (Sandbox Code Playgroud) 如何在MySQL中创建预备语句insert和select查询?我正在使用MySQL2 gem,我的连接对象如下所示:
con = Mysql2::Client.new(:host => "#{ENV['DB_HOST']}", :port => '3306', :username => "#{ENV['DB_UNAME']}", :password => "#{ENV['DB_PWD']}", :database => 'dbname')
Run Code Online (Sandbox Code Playgroud)