PHP中的MySQL命令问题

    技术2022-07-10  144

             在学习时发现PHP中的mysql已经不支持之前版本的命令操作了,示列如下:

            新版中的PHP—mysql操作:

            load_file和out_file的问题,在mysql下如何查看是否支持文件数据操作呢?

    show global variables like '%secure%';

             

            在MySQL目录中找到my.ini文件,打开查看是否有secure_file_priv,用于指定写入读取操作的目录。没有则自己修改添加一下即可。此外,PHP下的MySQL在测试执行时会经常报连接中断,重启一下就好了。

    [mysql] default-character-set=utf8 [mysqld] port=3306 basedir=D:/phpstudy_pro/Extensions/MySQL5.7.26/ datadir=D:/phpstudy_pro/Extensions/MySQL5.7.26/data/ character-set-server=utf8 default-storage-engine=MyIsam max_connections=100 collation-server=utf8_unicode_ci init_connect='SET NAMES utf8' innodb_buffer_pool_size=64M innodb_flush_log_at_trx_commit=1 innodb_lock_wait_timeout=120 innodb_log_buffer_size=4M innodb_log_file_size=256M interactive_timeout=120 join_buffer_size=2M key_buffer_size=32M log_error_verbosity=1 max_allowed_packet=16M max_heap_table_size=64M myisam_max_sort_file_size=64G myisam_sort_buffer_size=32M read_buffer_size=512kb read_rnd_buffer_size=4M server_id=1 skip-external-locking=on sort_buffer_size=256kb table_open_cache=256 thread_cache_size=16 tmp_table_size=64M wait_timeout=120 secure-file-priv=C:/ [client] port=3306 default-character-set=utf8

    into dumpfile()into outfile()load_file()详见:https://www.cnblogs.com/zztac/p/11371149.html
    Processed: 0.008, SQL: 9