Memristors have emerged as key candidates for beyond-von-Neumann neuromorphic or in-memory computing owing to the feasibility of their ultrahigh-density three-dimensional integration and their ultralow energy consumption. A memristor is generally a two-terminal electronic element with conductance that varies nonlinearly with external electric stimuli and can be remembered when the electric power is turned off. As an alternative, light can be used to tune the memconductance and endow a memristor with a combination of the advantages of both photonics and electronics. Both increases and decreases in optically induced memconductance have been realized in different memristors; however, the reversible tuning of memconductance with light in the same device remains a considerable challenge that severely restricts the development of optoelectronic memristors. Here we describe an all-optically controlled (AOC) analog memristor with memconductance that is reversibly tunable over a continuous range by varying only the wavelength of the controlling light. Our memristor is based on the relatively mature semiconductor material InGaZnO (IGZO) and a memconductance tuning mechanism of light-induced electron trapping and detrapping. We demonstrate that spike-timing-dependent plasticity (STDP) learning can be realized in our device, indicating its potential applications in AOC spiking neural networks (SNNs) for highly efficient optoelectronic neuromorphic computing.